34 #ifndef GUM_DAG_CYCLE_DETECTOR_H 35 #define GUM_DAG_CYCLE_DETECTOR_H 39 #include <agrum/tools/graphs/DAG.h> 77 virtual ~
Change()
noexcept;
124 ArcAdd(NodeId tail, NodeId head)
noexcept;
164 ArcDel(NodeId tail, NodeId head)
noexcept;
203 ArcReverse(NodeId tail, NodeId head)
noexcept;
276 void setDAG(
const DAG& dag);
282 void addArc(NodeId x, NodeId y);
332 const NodeProperty< Size >& set_to_add,
333 Size multiplier)
const;
337 const NodeProperty< Size >& set_to_del,
338 Size multiplier)
const;
344 const NodeProperty< Size >& set_to_restrict,
345 const NodeSet& extrmities)
const;
350 #ifndef GUM_NO_INLINE 351 # include <agrum/tools/graphs/algorithms/DAGCycleDetector_inl.h> ~DAGCycleDetector()
destructor
DiGraph _dag_
the initial dag from which modifications are applied
the base class indicating the possible changes
~ArcDel() noexcept
destructor
NodeId tail() const noexcept
indicates the tail of the arc involved in the modification
ArcAdd(ArcAdd &&from) noexcept
move constructor
ArcAdd(const ArcAdd &from) noexcept
copy constructor
INLINE void emplace(Args &&... args)
ArcAdd & operator=(const ArcAdd &from) noexcept
copy operator
Change(Change &&from) noexcept
void eraseArc(NodeId x, NodeId y)
removes an arc from the current DAG
ArcDel(NodeId tail, NodeId head) noexcept
default constructor
virtual ~Change() noexcept
void _delWeightedSet_(NodeProperty< Size > &nodeset, const NodeProperty< Size > &set_to_del, Size multiplier) const
removes a weighted nodeset from another (weights are subtracted)
void addArc(NodeId x, NodeId y)
adds a new arc to the current DAG
ChangeType type() const noexcept
returns the type of the operation
ArcReverse(NodeId tail, NodeId head) noexcept
default constructor
void _restrictWeightedSet_(NodeProperty< Size > &result_set, const NodeProperty< Size > &set_to_restrict, const NodeSet &extrmities) const
put into a weighted nodeset the nodes of another weighted set that belong to a set of arc extremities...
the class to indicate that we wish to reverse an arc
Change & operator=(const Change &from) noexcept
~ArcReverse() noexcept
destructor
bool hasCycleFromModifications(const std::vector< Change > &modifs) const
indicates whether a set of modifications would create a cycle
DAGCycleDetector & operator=(const DAGCycleDetector &from)
copy operator
ChangeType _type_
the type of modification
Change & operator=(Change &&from) noexcept
void setDAG(const DAG &dag)
sets the initial DAG from which changes shall be applied
NodeId head() const noexcept
indicates the head of the arc involved in the modification
the class to indicate that we wish to add a new arc
ArcDel(ArcDel &&from) noexcept
move constructor
ArcDel & operator=(ArcDel &&from) noexcept
move operator
DAGCycleDetector(const DAGCycleDetector &from)
copy constructor
ArcReverse(const ArcReverse &from) noexcept
copy constructor
NodeId _head_
the head of the arc to be modified
Change(ChangeType type, NodeId tail, NodeId head) noexcept
DAGCycleDetector(DAGCycleDetector &&from)
move constructor
NodeProperty< NodeProperty< Size > > _descendants_
the set of descendants of each node in the dag
ArcDel(const ArcDel &from) noexcept
copy constructor
NodeId _tail_
the tail of the arc to be modified
void _addWeightedSet_(NodeProperty< Size > &nodeset, const NodeProperty< Size > &set_to_add, Size multiplier) const
adds a weighted nodeset to another (weights are added)
ArcReverse & operator=(const ArcReverse &from) noexcept
copy operator
~ArcAdd() noexcept
destructor
bool operator!=(const DAGCycleDetector &from) const
check the inequality between two DAGCycleDetectors
bool hasCycleFromAddition(NodeId x, NodeId y) const noexcept
indicates whether an arc addition would create a cycle
ArcReverse(ArcReverse &&from) noexcept
move constructor
bool hasCycleFromReversal(NodeId x, NodeId y) const noexcept
indicates wether an arc reversal would create a cycle
bool hasCycleFromDeletion(NodeId x, NodeId y) const noexcept
indicates whether an arc deletion would create a cycle
DAGCycleDetector & operator=(DAGCycleDetector &&from)
move operator
ArcDel & operator=(const ArcDel &from) noexcept
copy operator
DAGCycleDetector() noexcept
default constructor
the class to indicate that we wish to remove an arc
ArcAdd & operator=(ArcAdd &&from) noexcept
move operator
bool operator==(const DAGCycleDetector &from) const
check the equality between two DAGCycleDetectors
ArcReverse & operator=(ArcReverse &&from) noexcept
move operator
ArcAdd(NodeId tail, NodeId head) noexcept
default constructor
void reverseArc(NodeId x, NodeId y)
reverses an arc from the DAG
Change(const Change &from) noexcept