82 inline edge(
const label from,
const label to);
91 inline edge(
const label from,
const label to,
const bool doSort);
160 inline label
which(const label vertex) const;
171 inline label
otherVertex(const label vertex) const;
190 inline label
count()
const;
203 inline
bool insert(const label vertex);
206 template<class InputIterator>
207 inline label
insert(InputIterator begIter, InputIterator endIter);
213 inline label
insert(
std::initializer_list<label> list);
233 inline label
erase(const label vertex);
236 template<class InputIterator>
237 inline label
erase(InputIterator begIter, InputIterator endIter);
241 inline label
erase(
std::initializer_list<label> list);
296 inline label& operator[](const label i);
299 inline const label& operator[](const label i) const;
305 inline
unsigned hash_code(
unsigned seed=0)
const 339 template<
class Unused=
bool>
340 struct Hash : edge::hasher
350 template<>
struct is_contiguous<edge> : std::true_type {};
353 template<>
struct is_contiguous_label<edge> : std::true_type {};
356 template<>
struct Hash<edge> : edge::hasher {};
364 return edge(
e.second(),
e.first());
371 inline bool operator==(
const edge& a,
const edge&
b);
374 inline bool operator!=(
const edge& a,
const edge&
b);
label count() const
Return the number of unique, valid (non -1) vertex labels.
unsigned operator()(const edge &obj, unsigned seed=0) const
const label & first() const noexcept
Access the first element.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
bool valid() const noexcept
Same as good()
edge reverseEdge() const
Return reverse edge as copy.
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.
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
bool empty() const noexcept
Return true if edge has no valid vertex labels.
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 (from first to second).
const label & other(const label &a) const
Return other element.
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 start() const noexcept
The start (first) vertex label.
void clear()
'Clears' edge by setting both ends to invalid vertex labels.
label minVertex() const noexcept
Return the smallest vertex label used by the edge.
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 vertex labels. This can correspond to a directed graph edge or an edge on a ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
label which(const label vertex) const
Return local index (0,1) of vertex label in edge -1 on failure.
label collapse()
'Collapse' edge by marking duplicate vertex 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 (from first to second).
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 a() const noexcept
The first vertex.
static const char *const typeName
The typeName ("edge")
label otherVertex(const label vertex) const
Given one vertex label, return the other one.
const Vector< label > N(dict.get< Vector< label >>("N"))
bool found(label vertex) const
Same as contains()
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
bool insert(const label vertex)
Fill any open slot with the vertex label (if not previously contained in the edge).
label maxVertex() const noexcept
Return the largest vertex label used by the edge.
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
edge()
Default construct, with invalid vertex labels (-1)
scalar magSqr(const UList< point > &pts) const
The length (L2-norm) squared of the edge vector.
bool contains(const label vertex) const noexcept
Return true if the vertex label is contained in the edge.
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.
static int compare(const edge &a, const edge &b)
Compare edges.