aGrUM  0.16.0
structuralConstraintPossibleEdges_inl.h
Go to the documentation of this file.
1 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 
31 namespace gum {
32 
33  namespace learning {
34 
36  INLINE void
38 
40  INLINE bool
42  NodeId y) const {
45  return res;
46  }
47 
49  INLINE bool
51  NodeId y) const {
52  return true;
53  }
54 
56  INLINE bool
58  NodeId y) const {
61  }
62 
65  const ArcAddition& change) const {
66  return checkArcAdditionAlone(change.node1(), change.node2());
67  }
68 
71  const ArcDeletion& change) const {
72  return checkArcDeletionAlone(change.node1(), change.node2());
73  }
74 
77  const ArcReversal& change) const {
78  return checkArcReversalAlone(change.node1(), change.node2());
79  }
80 
83  const GraphChange& change) const {
84  switch (change.type()) {
86  return checkArcAdditionAlone(change.node1(), change.node2());
87 
89  return checkArcDeletionAlone(change.node1(), change.node2());
90 
92  return checkArcReversalAlone(change.node1(), change.node2());
93 
94  default:
95  GUM_ERROR(OperationNotAllowed,
96  "edge modifications are not "
97  "supported by StructuralConstraintPossibleEdges");
98  }
99  }
100 
103  const ArcAddition& change) {}
104 
107  const ArcDeletion& change) {}
108 
111  const ArcReversal& change) {}
112 
115  const GraphChange& change) {}
116 
119  const GraphChange& change) const {
120  switch (change.type()) {
122  return !checkArcAdditionAlone(change.node1(), change.node2());
123 
124  case GraphChangeType::ARC_DELETION: return false;
125 
127  return !checkArcAdditionAlone(change.node2(), change.node1());
128 
129  default:
130  GUM_ERROR(OperationNotAllowed,
131  "edge modifications are not supported "
132  "by StructuralConstraintPossibleEdges");
133  }
134  }
135 
137  INLINE void StructuralConstraintPossibleEdges::setEdges(const EdgeSet& set) {
139  }
140 
142  INLINE void StructuralConstraintPossibleEdges::addEdge(const Edge& edge) {
144  }
145 
147  INLINE void StructuralConstraintPossibleEdges::eraseEdge(const Edge& edge) {
149  }
150 
152  INLINE const EdgeSet& StructuralConstraintPossibleEdges::edges() const {
154  }
155 
156 // include all the methods applicable to the whole class hierarchy
157 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintPossibleEdges
159 # undef GUM_CONSTRAINT_CLASS_NAME
160 
161  } /* namespace learning */
162 
163 } /* namespace gum */
164 
165 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
void addEdge(const Edge &edge)
assign a new forbidden arc
bool empty() const noexcept
Indicates whether the set is the empty set.
Definition: set_tpl.h:707
void setEdges(const EdgeSet &set)
assign a set of forbidden arcs
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
EdgeSet _PossibleEdges__possible_edges
the PossibleEdges on which we perform checks
void erase(const Key &k)
Erases an element from the set.
Definition: set_tpl.h:656
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
Definition: set_tpl.h:607
void modifyGraphAlone(const ArcAddition &change)
notify the constraint of a modification of the graph
const EdgeSet & edges() const
returns the set of mandatory arcs
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
void eraseEdge(const Edge &edge)
remove a forbidden arc
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
Size NodeId
Type for node ids.
Definition: graphElements.h:98
void insert(const Key &k)
Inserts a new element into the set.
Definition: set_tpl.h:613
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55