22 #ifndef GUM_ARC_GRAPH_PART_H 23 #define GUM_ARC_GRAPH_PART_H 28 #include <agrum/agrum.h> 30 #include <agrum/tools/core/signal/signaler.h> 31 #include <agrum/tools/graphs/graphElements.h> 94 bool arcs_resize_policy =
true);
134 virtual void addArc(NodeId tail, NodeId head);
141 virtual void eraseArc(
const Arc& arc);
153 bool existsArc(NodeId tail, NodeId head)
const;
252 template <
typename VAL >
262 template <
typename VAL >
268 template <
typename VAL >
323 std::ostream& operator<<(std::ostream& s,
const ArcGraphPart& a);
327 #ifndef GUM_NO_INLINE 328 # include <agrum/tools/graphs/parts/arcGraphPart_inl.h> 331 #include <agrum/tools/graphs/parts/arcGraphPart_tpl.h> std::vector< NodeId > directedUnorientedPath(NodeId node1, NodeId node2) const
returns an unoriented (directed) path from node1 to node2 in the arc set
void _checkParents_(NodeId id) const
when the ArcGraphPart contains no arc ingoing into a given node, this function adds an empty set entr...
NodeProperty< NodeSet *> _children_
for each arc, the set of its children
std::string toString() const
to friendly display the content of the ArcGraphPart
void eraseChildren(NodeId id)
removes all the children of a given node
ArcGraphPart & operator=(const ArcGraphPart &s)
copy operator
NodeSet family(NodeId id) const
returns the set of nodes which consists in the node and its parents
void clearArcs()
removes all the arcs from the ArcGraphPart
Classes for directed edge sets.
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
INLINE void emplace(Args &&... args)
NodeSet family(const NodeSet &ids) const
returns the set of family nodes of a set of nodes
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
void unvirtualizedEraseChildren(NodeId id)
same function as eraseChildren but without any virtual call to an erase
NodeSet children(const NodeSet &ids) const
returns the set of children of a set of nodes
ArcProperty< VAL > arcsProperty(VAL(*f)(const Arc &), Size size=0) const
a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL f(x))
virtual void addArc(NodeId tail, NodeId head)
insert a new arc into the ArcGraphPart
Set< Arc > _arcs_
the set of all the arcs contained within the ArcGraphPart
bool emptyArcs() const
indicates wether the ArcGraphPart contains any arc
void _checkChildren_(NodeId id) const
when the ArcGraphPart contains no arc outgoing from a given node, this function adds an empty set ent...
bool operator!=(const ArcGraphPart &p) const
tests whether two ArcGraphParts contain different arcs
ArcGraphPart(const ArcGraphPart &s)
copy constructor
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart
void unvirtualizedEraseSetOfArcs_(const ArcSet &set)
similar to eraseSetOfArcs_ except that it is unvirtualized
bool operator==(const ArcGraphPart &p) const
tests whether two ArcGraphParts contain the same arcs
ArcSetIterator ArcIterator
Signaler2< NodeId, NodeId > onArcAdded
bool existsArc(NodeId tail, NodeId head) const
indicates whether a given arc exists
virtual ~ArcGraphPart()
destructor
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
std::vector< NodeId > directedPath(NodeId node1, NodeId node2) const
returns a directed path from node1 to node2 belonging to the set of arcs
NodeSet parents(const NodeSet &ids) const
returns the set of parents of a set of nodes
const NodeSet & children(NodeId id) const
returns the set of nodes with arc outgoing from a given node
NodeProperty< NodeSet *> _parents_
for each arc, the sets of its parents
void eraseParents(NodeId id)
erase all the parents of a given node
ArcProperty< VAL > arcsProperty(const VAL &a, Size size=0) const
a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL a)
Signaler2< NodeId, NodeId > onArcDeleted
NodeSet descendants(NodeId id) const
returns the set of nodes with directed path outgoing from a given node
NodeSet ancestors(NodeId id) const
returns the set of nodes with directed path ingoing to a given node
List< VAL > listMapArcs(VAL(*f)(const Arc &)) const
a method to create a list of VAL from a set of arcs (using for every arc, say x, the VAL f(x)) ...
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
void eraseSetOfArcs_(const ArcSet &set)
a (virtualized) function to remove a given set of arcs
ArcGraphPart(Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
void unvirtualizedEraseParents(NodeId id)
same function as eraseParents but without any virtual call to an erase