28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 43 for (
auto node : graph)
44 g.addNodeWithId(node);
46 for (
auto& arc : graph.arcs())
47 g.addArc(arc.tail(), arc.head());
56 for (
NodeId i = 0; i < nb_nodes; ++i) {
83 const ArcAddition& change)
const {
89 const ArcDeletion& change)
const {
95 const ArcReversal& change)
const {
101 const GraphChange& change)
const {
102 switch (change.type()) {
114 "edge modifications are not " 115 "supported by StructuralConstraintDAG");
140 switch (change.type()) {
155 "edge modifications are not supported by DAG constraints");
167 constraints::setGraph(graph);
178 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintDAG 180 # undef GUM_CONSTRAINT_CLASS_NAME bool checkModificationAlone(const ArcAddition &change) const
checks whether the constraints enable to add an arc
void setGraph(const DAG &graph)
sets a new graph from which we will perform checkings
void setGraph(Size nb_nodes)
sets a new empty graph from which we will perform checkings
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
void eraseArc(NodeId x, NodeId y)
removes an arc from the current DAG
void addArc(NodeId x, NodeId y)
adds a new arc to the current DAG
void modifyGraphAlone(const ArcAddition &change)
notify the constraint of a modification of the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
void setDAG(const DAG &dag)
sets the initial DAG from which changes shall be applied
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)
bool hasCycleFromAddition(NodeId x, NodeId y) const noexcept
indicates whether an arc addition would create a cycle
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
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
DAGCycleDetector _DAG__cycle_detector
the cycle detector used to check quickly graph modifications
#define GUM_ERROR(type, msg)
void reverseArc(NodeId x, NodeId y)
reverses an arc from the DAG