81 inline edge(
const label from,
const label to);
90 inline edge(
const label from,
const label to,
const bool doSort);
158 inline bool found(
const label pointLabel)
const;
162 inline label
which(
const label pointLabel)
const;
173 inline label
otherVertex(
const label pointLabel)
const;
192 inline label
count()
const;
195 inline bool empty()
const;
204 inline bool insert(
const label index);
207 template<
class InputIterator>
208 inline label
insert(InputIterator begIter, InputIterator endIter);
214 inline label
insert(std::initializer_list<label> list);
233 inline label
erase(
const label index);
236 template<
class InputIterator>
237 inline label
erase(InputIterator begIter, InputIterator endIter);
241 inline label
erase(std::initializer_list<label> list);
295 inline const label&
operator[](
const label i)
const;
301 inline unsigned hash_code(
unsigned seed=0)
const 320 return obj.hash_code(seed);
326 template<
class Unused=
bool>
327 struct Hash : edge::hasher
337 template<>
struct is_contiguous<edge> : std::true_type {};
340 template<>
struct is_contiguous_label<edge> : std::true_type {};
343 template<>
struct Hash<edge> : edge::hasher {};
351 return edge(
e.second(),
e.first());
358 inline bool operator==(
const edge& a,
const edge&
b);
361 inline bool operator!=(
const edge& a,
const edge&
b);
label count() const
Return the number of unique, valid (non -1) point labels.
unsigned operator()(const edge &obj, unsigned seed=0) const
label which(const label pointLabel) const
Return local index (0,1) of point label in edge -1 on failure.
const label & first() const noexcept
Access the first element.
bool found(const label pointLabel) const
Return true if point label is found in edge.
scalar mag(const UList< point > &pts) const
Return scalar magnitude of the edge.
bool valid() const noexcept
True if the vertices are unique and non-negative.
edge reverseEdge() const
Return reverse edge as copy.
bool empty() const
Return true if edge has no valid point labels.
linePointRef line(const UList< point > &pts) const
Return edge line.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
unsigned hash_code(unsigned seed=0) const
The (commutative) hash value for edge, hashes lower value first.
label b() const noexcept
The second vertex.
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
bool connects(const edge &other) const
Do the edges share a common vertex index?
vector unitVec(const UList< point > &pts) const
Return the unit vector (end - start)
label erase(const label index)
Remove an existing index from the edge and set its location to '-1'.
const label & other(const label &a) const
Return other element.
label start() const noexcept
The start (first) vertex label.
void clear()
'Clears' edge by setting both ends to invalid point labels.
bool insert(const label index)
Fill any open slot with the index if it did not previously exist.
const dimensionedScalar e
Elementary charge.
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
label minVertex() const
Return the smallest point label used by the edge.
label collapse()
'Collapse' edge by marking duplicate point labels as '-1', the lower vertex is retained.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
vector vec(const UList< point > &pts) const
Return the vector (end - start)
Pair< point > box(const UList< point > &pts) const
The enclosing (bounding) box for the edge.
bool good() const noexcept
True if the vertices are unique and non-negative.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label maxVertex() const
Return the largest point label used by the edge.
label a() const noexcept
The first vertex.
static const char *const typeName
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
edge()
Default construct, with invalid point labels (-1)
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
bool operator!=(const eddy &a, const eddy &b)
label end() const noexcept
The end (last/second) vertex label.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
const label & second() const noexcept
Access the second element.
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.
static int compare(const edge &a, const edge &b)
Compare edges.