22 #ifndef GUM_EDGE_GRAPH_PART_H 23 #define GUM_EDGE_GRAPH_PART_H 26 #include <agrum/agrum.h> 30 #include <agrum/tools/core/signal/signaler.h> 32 #include <agrum/tools/graphs/graphElements.h> 90 bool edges_resize_policy =
true);
130 virtual void addEdge(
const NodeId n1,
const NodeId n2);
137 virtual void eraseEdge(
const Edge& edge);
149 bool existsEdge(
const NodeId n1,
const NodeId n2)
const;
193 template <
typename VAL >
204 template <
typename VAL >
210 template <
typename VAL >
237 bool hasUndirectedPath(
const NodeId n1,
const NodeId n2,
const NodeSet& except)
const;
246 bool hasUndirectedPath(
const NodeSet& n1,
const NodeSet& n2,
const NodeSet& except)
const;
263 std::ostream& operator<<(std::ostream&,
const EdgeGraphPart&);
267 #ifndef GUM_NO_INLINE 268 # include <agrum/tools/graphs/parts/edgeGraphPart_inl.h> 271 #include <agrum/tools/graphs/parts/edgeGraphPart_tpl.h> EdgeSet _edges_
the set of all the edges contained within the EdgeGraphPart
const std::vector< NodeId > undirectedPath(const NodeId node1, const NodeId node2) const
returns a possible path from node1 to node2 in the edge set
EdgeGraphPart(Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
default constructor
EdgeSetIterator EdgeIterator
bool operator==(const EdgeGraphPart &p) const
tests whether two EdgeGraphParts contain the same edges
std::string toString() const
to friendly display the content of the EdgeGraphPart
EdgeGraphPart & operator=(const EdgeGraphPart &s)
copy operator
INLINE void emplace(Args &&... args)
bool emptyEdges() const
indicates wether the EdgeGraphPart contains any edge
virtual void addEdge(const NodeId n1, const NodeId n2)
insert a new edge into the EdgeGraphPart
EdgeGraphPart(const EdgeGraphPart &s)
copy constructor
Classes for undirected edge sets.
EdgeProperty< VAL > edgesProperty(const VAL &a, Size size=0) const
a method to create a hashMap of VAL from a set of edges (using for every edge, say x...
bool hasUndirectedPath(const NodeId n1, const NodeId n2, const NodeSet &except) const
return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the g...
const NodeSet & neighbours(const NodeId id) const
returns the set of node neighbours to a given node
EdgeProperty< VAL > edgesProperty(VAL(*f)(const Edge &), Size size=0) const
a method to create a hashMap of VAL from a set of edges (using for every edge, say x...
void _checkNeighbours_(const NodeId id) const
when the EdgeGraphPart contains no edge adjacent to a given node, this function adds an empty set ent...
virtual void clearEdges()
removes all the edges from the EdgeGraphPart
bool hasUndirectedPath(const NodeId n1, const NodeId n2) const
return true if n1 and n2 are connected (by an undirected path) in the graph.
const EdgeSet & edges() const
returns the set of edges stored within the EdgeGraphPart
bool hasUndirectedPath(const NodeSet &n1, const NodeSet &n2, const NodeSet &except) const
return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the g...
List< VAL > listMapEdges(VAL(*f)(const Edge &)) const
a method to create a list of VAL from a set of edges (using for every edge, say x, the VAL f(x))
bool existsEdge(const Edge &edge) const
indicates whether a given edge exists
virtual ~EdgeGraphPart()
destructor
Signaler2< NodeId, NodeId > onEdgeDeleted
bool operator!=(const EdgeGraphPart &p) const
tests whether two EdgeGraphParts contain different edges
bool existsEdge(const NodeId n1, const NodeId n2) const
indicates whether a given edge exists
Size sizeEdges() const
indicates the number of edges stored within the EdgeGraphPart
void unvirtualizedEraseNeighbours(const NodeId id)
same function as eraseNeighbours but without any virtual call to an erase
NodeProperty< NodeSet *> _neighbours_
for each node, the set of its adjacent edges
virtual void eraseEdge(const Edge &edge)
removes an edge from the EdgeGraphPart
Signaler2< NodeId, NodeId > onEdgeAdded
void eraseNeighbours(const NodeId id)
erase all the edges adjacent to a given node