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
376 template<>
struct is_contiguous<edge> : std::true_type {};
379 template<>
struct is_contiguous_label<edge> : std::true_type {};
382 template<>
struct Hash<edge> : edge::hasher {};
390 return edge(
e.second(),
e.first());
397 inline bool operator==(
const edge& a,
const edge&
b);
400 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.
void sort()
Sort so that first() is less-than second()
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?
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
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 minVert() const noexcept
Same as min()
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...
Pair< label > labelPair
A pair of labels.
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).
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)
static edge sorted(label from, label to)
Create (in ascending order) from two vertex labels.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
const label & second() const noexcept
Access the second element.
label max() const noexcept
Return the largest vertex label used by the edge.
label maxVert() const noexcept
Same as max()
label min() const noexcept
Return the smallest vertex label used by the edge.
FixedList()=default
Default construct.
label & end() noexcept
The end (second/last) vertex label.
static int compare(const edge &a, const edge &b)
Compare edges.