aGrUM  0.16.0
undiGraph_inl.h
Go to the documentation of this file.
1 
30 // to ease parser
31 #include <agrum/graphs/undiGraph.h>
32 
33 namespace gum {
34 
35  INLINE void UndiGraph::addEdge(const NodeId first, const NodeId second) {
36  if (!exists(first)) { GUM_ERROR(InvalidNode, "first node"); }
37 
38  if (!exists(second)) { GUM_ERROR(InvalidNode, "second node"); }
39 
40  EdgeGraphPart::addEdge(second, first);
41  }
42 
43  INLINE void UndiGraph::clear() {
46  }
47 
49  if (this != &g) {
53  }
54 
55  return *this;
56  }
57 
58  INLINE void UndiGraph::eraseNode(const NodeId id) {
59  // warning: to remove the edges adjacent to id, use the unvirtualized
60  // versions
61  // of edge removals
64  }
65 
66  INLINE bool UndiGraph::operator==(const UndiGraph& p) const {
68  }
69 
70  INLINE bool UndiGraph::operator!=(const UndiGraph& p) const {
71  return !operator==(p);
72  }
73 
74 } /* namespace gum */
NodeGraphPart & operator=(const NodeGraphPart &p)
copy operator
virtual void clear()
removes all the nodes and edges from the graph
Definition: undiGraph_inl.h:43
bool operator==(const EdgeGraphPart &p) const
tests whether two EdgeGraphParts contain the same edges
EdgeGraphPart & operator=(const EdgeGraphPart &s)
copy operator
virtual void addEdge(const NodeId first, const NodeId second)
insert a new edge into the undirected graph
Definition: undiGraph_inl.h:35
virtual void addEdge(const NodeId n1, const NodeId n2)
insert a new edge into the EdgeGraphPart
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool exists(const NodeId id) const
alias for existsNode
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
bool operator==(const NodeGraphPart &p) const
check whether two NodeGraphParts contain the same nodes
virtual void eraseNode(const NodeId id)
remove a node and its adjacent edges from the graph
Definition: undiGraph_inl.h:58
virtual void clearEdges()
removes all the edges from the EdgeGraphPart
bool operator!=(const UndiGraph &g) const
tests whether two UndiGraphs are different
Definition: undiGraph_inl.h:70
bool operator==(const UndiGraph &g) const
tests whether two UndiGraphs are identical (same nodes, same edges)
Definition: undiGraph_inl.h:66
Base class for undirected graphs.
Definition: undiGraph.h:109
virtual void clearNodes()
remove all the nodes from the NodeGraphPart
void unvirtualizedEraseNeighbours(const NodeId id)
same function as eraseNeighbours but without any virtual call to an erase
UndiGraph & operator=(const UndiGraph &g)
copy operator
Definition: undiGraph_inl.h:48
Size NodeId
Type for node ids.
Definition: graphElements.h:98
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
virtual void eraseNode(const NodeId id)
erase the node with the given id