33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 51 n1(
std::min(aN1, aN2)), n2(
std::max(aN1, aN2)) {
53 GUM_CONSTRUCTOR(Edge);
58 INLINE
Edge::Edge(
const Edge& src) : n1(src.n1), n2(src.n2) {
88 GUM_ERROR(IdError,
id <<
" does not belong to this edge");
103 return ((
n1 == src.n1) && (
n2 == src.n2));
109 return ((
n1 != src.n1) || (
n2 != src.n2));
114 INLINE
Size HashFunc< Edge >::castToSize(
const Edge& key) {
120 INLINE
Size HashFunc< Edge >::operator()(
const Edge& key)
const {
121 return castToSize(key) & this->_hash_mask;
140 GUM_CONSTRUCTOR(Arc);
145 INLINE
Arc::Arc(
const Arc& src) : n1(src.n1), n2(src.n2) {
191 GUM_ERROR(IdError,
id <<
" does not belong to this arc");
206 return ((
n1 == src.n1) && (
n2 == src.n2));
212 return ((
n1 != src.n1) || (
n2 != src.n2));
225 INLINE
Size HashFunc< Arc >::castToSize(
const Arc& key) {
231 INLINE
Size HashFunc< Arc >::operator()(
const Arc& key)
const {
232 return castToSize(key) & this->_hash_mask;
NodeId second() const
returns the node ID of the other extremal node ID
void __setTail(NodeId id)
modifies the tail of the arc
static constexpr Size gold
NodeId n1
the extremal nodes of the edge (their order is unimportant)
Edge & operator=(const Edge &src)
copy operator
bool operator==(const Arc &src) const
checks whether two arcs are equal
NodeId other(NodeId id) const
returns an extremal node of an edge given the ID of the other one
Edge(NodeId aN1, NodeId aN2)
constructs a new edge (aN1,aN2)
bool operator!=(const Arc &src) const
check if two arcs are different
gum is the global namespace for all aGrUM entities
void operator-()
reverses the direction of the arc
NodeId head() const
returns the head of the arc
NodeId second() const
returns the node ID of the other extremal node ID
NodeId first() const
returns one extremal node ID (whichever one it is is unspecified)
Arc(NodeId tail, NodeId head)
basic constructor. Creates tail -> head.
bool operator!=(const Edge &src) const
checks whether two undirected edges are different
void __setHead(NodeId id)
modifies the head of the arc
Arc & operator=(const Arc &src)
copy operator
std::size_t Size
In aGrUM, hashed values are unsigned long int.
NodeId n1
the extremal nodes of the edge (their order is unimportant)
bool operator==(const Edge &src) const
checks whether two undirected edges are equal
NodeId first() const
returns one extremal node ID (whichever one it is is unspecified)
Size NodeId
Type for node ids.
NodeId tail() const
returns the tail of the arc
#define GUM_ERROR(type, msg)
NodeId other(NodeId id) const
returns an extremal node of an edge given the ID of the other one
some utils for topology : NodeId, Edge, Arc and consorts ...