81 inline edge(
const label from,
const label to);
90 inline edge(
const label from,
const label to,
const bool doSort);
121 inline label
start()
const;
124 inline label&
start();
127 inline label
end()
const;
148 inline bool valid()
const;
152 inline bool found(
const label pointLabel)
const;
156 inline label
which(
const label pointLabel)
const;
168 inline label
otherVertex(
const label pointLabel)
const;
183 inline label
count()
const;
186 inline bool empty()
const;
195 inline bool insert(
const label index);
198 template<
class InputIterator>
199 inline label
insert(InputIterator begIter, InputIterator endIter);
205 inline label
insert(std::initializer_list<label> list);
224 inline label
erase(
const label index);
227 template<
class InputIterator>
228 inline label
erase(InputIterator begIter, InputIterator endIter);
232 inline label
erase(std::initializer_list<label> list);
283 inline const label&
operator[](
const label i)
const;
289 inline unsigned hash_code(
unsigned seed=0)
const
314 template<
class Unused=
bool>
346inline bool operator==(
const edge& a,
const edge&
b);
349inline bool operator!=(
const edge& a,
const edge&
b);
A 1D vector of objects of type <T> with a fixed length <N>.
T & first() noexcept
The first element of the list, position [0].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const label & other(const label &a) const
Return other element.
const label & second() const noexcept
Return second element, which is also the last element.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Return the first element of the list.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static int compare(const edge &a, const edge &b)
Compare edges.
bool valid() const
Return true if the vertices are unique and non-negative.
bool insert(const label index)
Fill any open slot with the index if it did not previously exist.
unsigned hash_code(unsigned seed=0) const
The (commutative) hash value for edge, hashes lower value first.
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
edge reverseEdge() const
Return reverse edge as copy.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
label end() const
Return end (last/second) vertex label.
bool empty() const
Return true if edge has no valid point labels.
label erase(InputIterator begIter, InputIterator endIter)
Remove values, using begin/end iterators.
vector unitVec(const UList< point > &pts) const
Return the unit vector (end - start)
label which(const label pointLabel) const
Return local index (0,1) of point label in edge -1 on failure.
label insert(const FixedList< label, N > &list)
Fill open slots with the indices if they did not previously exist.
label erase(const FixedList< label, N > &list)
Remove existing indices from the edge and set locations to '-1'.
edge()
Default construct, with invalid point labels (-1)
vector vec(const UList< point > &pts) const
Return the vector (end - start)
scalar mag(const UList< point > &pts) const
Return scalar magnitude of the edge.
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
label minVertex() const
Return the smallest point label used by the edge.
label insert(InputIterator begIter, InputIterator endIter)
Insert values, using begin/end iterators.
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.
void clear()
'Clears' edge by setting both ends to invalid point labels.
label count() const
Return the number of unique, valid (non -1) point labels.
bool connects(const edge &other) const
Do the edges share a common vertex index?
static const char *const typeName
label maxVertex() const
Return the largest point label used by the edge.
label erase(const label index)
Remove an existing index from the edge and set its location to '-1'.
label start() const
Return start (first) vertex label.
bool operator!=(const eddy &a, const eddy &b)
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 > &)
#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.