82 inline edge(label from, label to);
104 inline static edge sorted(label from, label to);
166 inline label
which(const label vertex) const;
177 inline label
otherVertex(const label vertex) const;
196 inline label
count()
const;
209 inline
bool insert(const label vertex);
212 template<class InputIterator>
213 inline label
insert(InputIterator begIter, InputIterator endIter);
219 inline label
insert(std::initializer_list<label> list);
239 inline label
erase(const label vertex);
242 template<class InputIterator>
243 inline label
erase(InputIterator begIter, InputIterator endIter);
247 inline label
erase(std::initializer_list<label> list);
302 inline label& operator[](const label i);
305 inline const label& operator[](const label i) const;
311 inline
unsigned hash_code(
unsigned seed=0)
const
339 edge(label from, label to,
bool doSort) :
labelPair(from, to)
365 template<
class Unused=
bool>
366 struct Hash : edge::hasher
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const label & other(const label &a) const
const label & first() const noexcept
const label & second() const noexcept
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Access first element of the list, position [0].
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
label b() const noexcept
The second vertex.
static int compare(const edge &a, const edge &b)
Compare edges.
Pair< point > box(const UList< point > &pts) const
The enclosing (bounding) box for the edge.
bool empty() const noexcept
Return true if edge has no valid vertex labels.
unsigned hash_code(unsigned seed=0) const
The (commutative) hash value for edge, hashes lower value first.
bool insert(const label vertex)
Fill any open slot with the vertex label (if not previously contained in the edge).
label maxVert() const noexcept
Same as max().
label max() const noexcept
Return the largest vertex label used by the edge.
edge reverseEdge() const
Return reverse edge as copy.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
bool good() const noexcept
True if the vertices are unique and non-negative.
scalar magSqr(const UList< point > &pts) const
The length (L2-norm) squared of the edge vector.
label & b() noexcept
The second vertex.
vector unitVec(const UList< point > &pts) const
Return the unit vector (from first to second).
label & end() noexcept
The end (second/last) vertex label.
bool contains(const label vertex) const noexcept
Return true if the vertex label is contained in the edge.
label which(const label vertex) const
Return local index (0,1) of vertex label in edge -1 on failure.
label a() const noexcept
The first vertex.
label & start() noexcept
The start (first) vertex label.
edge()
Default construct, with invalid vertex labels (-1).
bool valid() const noexcept
Same as good().
vector vec(const UList< point > &pts) const
Return the vector (from first to second).
linePointRef line(const UList< point > &pts) const
Return edge line.
label min() const noexcept
Return the smallest vertex label used by the edge.
label collapse()
'Collapse' edge by marking duplicate vertex labels as '-1', the lower vertex is retained.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
label erase(const label vertex)
Remove an existing vertex from the edge and set its location to '-1'. A negative vertex label never r...
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
label minVert() const noexcept
Same as min().
label start() const noexcept
The start (first) vertex label.
static edge sorted(label from, label to)
Create (in ascending order) from two vertex labels.
label count() const
Return the number of unique, valid (non -1) vertex labels.
label & a() noexcept
The first vertex.
label end() const noexcept
The end (last/second) vertex label.
bool found(label vertex) const
Same as contains().
bool connects(const edge &other) const
Do the edges share a common vertex index?
edge(const UList< label > &list, const FixedList< label, 2 > &indices)
Copy construct from a subset of vertex labels.
label otherVertex(const label vertex) const
Given one vertex label, return the other one.
static const char *const typeName
The typeName ("edge").
bool operator!=(const eddy &a, const eddy &b)
Pair< label > labelPair
A pair of labels.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
line< point, const point & > linePointRef
A line using referred points.
vector point
Point is a vector.
UList< label > labelUList
A UList of labels.
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
#define FOAM_DEPRECATED_FOR(since, replacement)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Deprecated(2021-04) hashing functor. Use hasher().
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
Hashing functor for edge (commutative).
unsigned operator()(const edge &obj, unsigned seed=0) const
A template class to specify if a data type is composed solely of Foam::label elements.
A template class to specify that a data type can be considered as being contiguous in memory.
const Vector< label > N(dict.get< Vector< label > >("N"))