aGrUM  0.16.0
structuralConstraintDiGraph.h
Go to the documentation of this file.
1 
29 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H
30 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H
31 
32 #include <agrum/agrum.h>
33 #include <agrum/graphs/diGraph.h>
36 
37 namespace gum {
38 
39  namespace learning {
40 
52  public:
53  // ##########################################################################
55  // ##########################################################################
57 
60 
63 
66 
69 
72 
75 
77 
78  // ##########################################################################
80  // ##########################################################################
82 
86 
89 
91 
92  // ##########################################################################
94  // ##########################################################################
96 
98  void setGraph(Size nb_nodes);
99 
101  void setGraphAlone(const DiGraph& graph);
102 
104 
108  void modifyGraphAlone(const ArcAddition& change);
109 
111 
113  void modifyGraphAlone(const ArcDeletion& change);
114 
116 
120  void modifyGraphAlone(const ArcReversal& change);
121 
123 
127  void modifyGraphAlone(const GraphChange& change);
128 
130 
143  bool isAlwaysInvalidAlone(const GraphChange& change) const;
144 
146 
148  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
149 
151 
152  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
153 
155 
157  bool checkArcReversalAlone(NodeId x, NodeId y) const;
158 
160 
165  bool checkModificationAlone(const GraphChange& change) const;
166 
168 
170  bool checkModificationAlone(const ArcAddition& change) const;
171 
173 
174  bool checkModificationAlone(const ArcDeletion& change) const;
175 
177 
179  bool checkModificationAlone(const ArcReversal& change) const;
180 
182 
183 #ifndef DOXYGEN_SHOULD_SKIP_THIS
184 // include the set of methods that enable the structural constraint to
185 // be standalone, i.e., that it needs not be included into a
186 // StructuralConstraintSetStatic to be used by learning algorithms
187 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintDiGraph
189 # undef GUM_CONSTRAINT_CLASS_NAME
190 #endif // DOXYGEN_SHOULD_SKIP_THIS
191 
192  protected:
195  };
196 
197  } /* namespace learning */
198 
199 } /* namespace gum */
200 
202 #ifndef GUM_NO_INLINE
204 #endif /* GUM_NO_INLINE */
205 
206 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setGraph(Size nb_nodes)
sets a new empty graph from which we will perform checkings
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.
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:150
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
StructuralConstraintDiGraph & operator=(const StructuralConstraintDiGraph &from)
copy operator
DiGraph _DiGraph__graph
the DiGraph on which we perform checks
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for all oriented graphs.
Definition: diGraph.h:111
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
The class for notifying learning algorithms of arc reversalsThis class is convenient to know at compi...
Definition: graphChange.h:282
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
The base class for structural constraints used by learning algorithms that learn a directed graph str...
Size NodeId
Type for node ids.
Definition: graphElements.h:98