56#ifndef DOXYGEN_SHOULD_SKIP_THIS
68 n1(std::min(aN1, aN2)), n2(std::max(aN1, aN2)) {
69 GUM_CONSTRUCTOR(Edge);
73 INLINE Edge::Edge(
const Edge& src) : n1(src.n1), n2(src.n2) {
78 INLINE Edge& Edge::operator=(
const Edge& src) {
87 INLINE Edge::~Edge() {
92 INLINE NodeId Edge::other(NodeId
id)
const {
93 if (
id == n1)
return n2;
94 else if (
id == n2)
return n1;
99 INLINE NodeId Edge::first()
const {
return n1; }
102 INLINE NodeId Edge::second()
const {
return n2; }
105 INLINE Size HashFunc< Edge >::castToSize(
const Edge& key) {
106 return Size(key.first()) * HashFuncConst::pi + Size(key.second()) * HashFuncConst::gold;
110 INLINE Size HashFunc< Edge >::operator()(
const Edge& key)
const {
111 return castToSize(key) & this->hash_mask_;
121 INLINE Arc::Arc(NodeId tail, NodeId head) : n1(tail), n2(head) {
122 GUM_CONSTRUCTOR(Arc);
126 INLINE Arc::Arc(
const Arc& src) : n1(src.n1), n2(src.n2) {
131 INLINE Arc& Arc::operator=(
const Arc& src) {
145 INLINE NodeId Arc::tail()
const {
return n1; }
148 INLINE
void Arc::_setTail_(NodeId
id) { n1 = id; }
151 INLINE NodeId Arc::head()
const {
return n2; }
154 INLINE
void Arc::_setHead_(NodeId
id) { n2 = id; }
157 INLINE NodeId Arc::other(NodeId
id)
const {
158 if (
id == n1)
return n2;
159 else if (
id == n2)
return n1;
164 INLINE NodeId Arc::first()
const {
return n1; }
167 INLINE NodeId Arc::second()
const {
return n2; }
170 INLINE
void Arc::operator-() {
177 INLINE Size HashFunc< Arc >::castToSize(
const Arc& key) {
178 return Size(key.first()) * HashFuncConst::pi + Size(key.second()) * HashFuncConst::gold;
182 INLINE Size HashFunc< Arc >::operator()(
const Arc& key)
const {
183 return castToSize(key) & this->hash_mask_;
Edge(NodeId aN1, NodeId aN2)
constructs a new edge (aN1,aN2)
Exception : node does not exist.
#define GUM_ERROR(type, msg)
some utils for topology : NodeId, Edge, Arc and consorts ...
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities