aGrUM  0.14.2
structuralConstraintDiGraph.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H
27 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H
28 
29 #include <agrum/agrum.h>
30 #include <agrum/graphs/diGraph.h>
33 
34 namespace gum {
35 
36  namespace learning {
37 
49  public:
50  // ##########################################################################
52  // ##########################################################################
54 
57 
60 
63 
66 
69 
72 
74 
75  // ##########################################################################
77  // ##########################################################################
79 
83 
86 
88 
89  // ##########################################################################
91  // ##########################################################################
93 
95  void setGraph(Size nb_nodes);
96 
98  void setGraphAlone(const DiGraph& graph);
99 
101 
105  void modifyGraphAlone(const ArcAddition& change);
106 
108 
110  void modifyGraphAlone(const ArcDeletion& change);
111 
113 
117  void modifyGraphAlone(const ArcReversal& change);
118 
120 
124  void modifyGraphAlone(const GraphChange& change);
125 
127 
140  bool isAlwaysInvalidAlone(const GraphChange& change) const;
141 
143 
145  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
146 
148 
149  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
150 
152 
154  bool checkArcReversalAlone(NodeId x, NodeId y) const;
155 
157 
162  bool checkModificationAlone(const GraphChange& change) const;
163 
165 
167  bool checkModificationAlone(const ArcAddition& change) const;
168 
170 
171  bool checkModificationAlone(const ArcDeletion& change) const;
172 
174 
176  bool checkModificationAlone(const ArcReversal& change) const;
177 
179 
180 #ifndef DOXYGEN_SHOULD_SKIP_THIS
181 // include the set of methods that enable the structural constraint to
182 // be standalone, i.e., that it needs not be included into a
183 // StructuralConstraintSetStatic to be used by learning algorithms
184 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintDiGraph
186 # undef GUM_CONSTRAINT_CLASS_NAME
187 #endif // DOXYGEN_SHOULD_SKIP_THIS
188 
189  protected:
192  };
193 
194  } /* namespace learning */
195 
196 } /* namespace gum */
197 
199 #ifndef GUM_NO_INLINE
201 #endif /* GUM_NO_INLINE */
202 
203 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_DIGRAPH_H */
Base classes for oriented graphs.
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
the classes to account for structure changes in a graph
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:147
The class for notifying learning algorithms of arc removalsThis class is convenient to know at compil...
Definition: graphChange.h:213
the base class for all structural constraints
the base class for structural constraints used by learning algorithms that learn a directed graph str...
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
gum is the global namespace for all aGrUM entities
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)
the base class for all structural constraints
Base class for all oriented graphs.
Definition: diGraph.h:108
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:279
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:45
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:97