aGrUM  0.16.0
structuralConstraintForbiddenArcs.h
Go to the documentation of this file.
1 
29 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_FORBIDDEN_ARCS_H
30 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_FORBIDDEN_ARCS_H
31 
32 #include <agrum/agrum.h>
33 #include <agrum/graphs/diGraph.h>
36 
37 namespace gum {
38 
39  namespace learning {
40 
47  : public virtual StructuralConstraintEmpty {
48  public:
49  // ##########################################################################
51  // ##########################################################################
53 
56 
59 
63 
66 
69 
71 
72  // ##########################################################################
74  // ##########################################################################
76 
80 
84 
86 
87  // ##########################################################################
89  // ##########################################################################
91 
93  void setArcs(const ArcSet& set);
94 
96  void addArc(const Arc& arc);
97 
99  void eraseArc(const Arc& arc);
100 
102  const ArcSet& arcs() const;
103 
105  void setGraphAlone(const DiGraph& graph);
106 
108 
112  void modifyGraphAlone(const ArcAddition& change);
113 
115 
117  void modifyGraphAlone(const ArcDeletion& change);
118 
120 
124  void modifyGraphAlone(const ArcReversal& change);
125 
127 
131  void modifyGraphAlone(const GraphChange& change);
132 
134 
147  bool isAlwaysInvalidAlone(const GraphChange& change) const;
148 
150 
152  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
153 
155 
156  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
157 
159 
161  bool checkArcReversalAlone(NodeId x, NodeId y) const;
162 
164 
169  bool checkModificationAlone(const GraphChange& change) const;
170 
172 
174  bool checkModificationAlone(const ArcAddition& change) const;
175 
177 
178  bool checkModificationAlone(const ArcDeletion& change) const;
179 
181 
183  bool checkModificationAlone(const ArcReversal& change) const;
184 
186 
187 #ifndef DOXYGEN_SHOULD_SKIP_THIS
188 // include the set of methods that enable the structural constraint to
189 // be standalone, i.e., that it needs not be included into a
190 // StructuralConstraintSetStatic to be used by learning algorithms
191 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintForbiddenArcs
193 # undef GUM_CONSTRAINT_CLASS_NAME
194 #endif // DOXYGEN_SHOULD_SKIP_THIS
195 
196  protected:
199  };
200 
201  } /* namespace learning */
202 
203 } /* namespace gum */
204 
206 #ifndef GUM_NO_INLINE
208 #endif /* GUM_NO_INLINE */
209 
210 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_FORBIDDEN_ARCS_H */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
the structural constraint for forbidding the creation of some arcs during structure learning ...
void addArc(const Arc &arc)
assign a new forbidden arc
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:150
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
ArcSet _ForbiddenArcs__forbidden_arcs
the ForbiddenArcs on which we perform checks
StructuralConstraintForbiddenArcs & operator=(const StructuralConstraintForbiddenArcs &from)
copy operator
The class for notifying learning algorithms of arc removalsThis class is convenient to know at compil...
Definition: graphChange.h:216
the base class for all structural constraints
void setArcs(const ArcSet &set)
assign a set of forbidden arcs
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
void eraseArc(const Arc &arc)
remove a forbidden arc
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
const ArcSet & arcs() const
returns the set of mandatory arcs
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
Base class for all oriented graphs.
Definition: diGraph.h:111
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
The class for notifying learning algorithms of arc reversalsThis class is convenient to know at compi...
Definition: graphChange.h:282
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.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)