57#ifndef DOXYGEN_SHOULD_SKIP_THIS
69 n1(std::min(aN1, aN2)), n2(std::max(aN1, aN2)) {
70 GUM_CONSTRUCTOR(Edge);
74 INLINE Edge::Edge(
const Edge& src) : n1(src.n1), n2(src.n2) {
79 INLINE Edge::Edge(Edge&& src) noexcept : n1(src.n1), n2(src.n2) {
84 INLINE
Edge& Edge::operator=(
const Edge& src) {
93 INLINE
Edge& Edge::operator=(Edge&& src)
noexcept {
102 INLINE Edge::~Edge() {
103 GUM_DESTRUCTOR(Edge);
107 INLINE NodeId Edge::other(NodeId
id)
const {
108 if (
id == n1)
return n2;
109 else if (
id == n2)
return n1;
114 INLINE NodeId Edge::first()
const {
return n1; }
117 INLINE NodeId Edge::second()
const {
return n2; }
120 INLINE Size HashFunc< Edge >::castToSize(
const Edge& key) {
121 return Size(key.first()) * HashFuncConst::pi + Size(key.second()) * HashFuncConst::gold;
125 INLINE Size HashFunc< Edge >::operator()(
const Edge& key)
const {
126 return castToSize(key) & this->hash_mask_;
136 INLINE Arc::Arc(NodeId tail, NodeId head) : n1(tail), n2(head) {
137 GUM_CONSTRUCTOR(Arc);
141 INLINE Arc::Arc(
const Arc& src) : n1(src.n1), n2(src.n2) {
146 INLINE Arc::Arc(Arc&& src) noexcept : n1(src.n1), n2(src.n2) {
151 INLINE
Arc& Arc::operator=(
const Arc& src) {
160 INLINE
Arc& Arc::operator=(Arc&& src)
noexcept {
174 INLINE NodeId Arc::tail()
const {
return n1; }
177 INLINE
void Arc::_setTail_(NodeId
id) { n1 = id; }
180 INLINE NodeId Arc::head()
const {
return n2; }
183 INLINE
void Arc::_setHead_(NodeId
id) { n2 = id; }
186 INLINE NodeId Arc::other(NodeId
id)
const {
187 if (
id == n1)
return n2;
188 else if (
id == n2)
return n1;
193 INLINE NodeId Arc::first()
const {
return n1; }
196 INLINE NodeId Arc::second()
const {
return n2; }
199 INLINE
void Arc::operator-() {
206 INLINE Size HashFunc< Arc >::castToSize(
const Arc& key) {
207 return Size(key.first()) * HashFuncConst::pi + Size(key.second()) * HashFuncConst::gold;
211 INLINE Size HashFunc< Arc >::operator()(
const Arc& key)
const {
212 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