aGrUM  0.14.2
structuralConstraintUndiGraph.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_UNDIGRAPH_H
27 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_UNDIGRAPH_H
28 
29 #include <agrum/agrum.h>
30 #include <agrum/graphs/undiGraph.h>
33 
34 namespace gum {
35 
36  namespace learning {
37 
48  : public virtual StructuralConstraintEmpty {
49  public:
50  // ##########################################################################
52  // ##########################################################################
54 
57 
60 
63 
66 
69 
72 
74 
75  // ##########################################################################
77  // ##########################################################################
79 
83 
87 
89 
90  // ##########################################################################
92  // ##########################################################################
94 
96  void setGraph(Size nb_nodes);
97 
99  void setGraphAlone(const UndiGraph& graph);
100 
102 
106  void modifyGraphAlone(const EdgeAddition& change);
107 
109 
111  void modifyGraphAlone(const EdgeDeletion& change);
112 
114 
119  void modifyGraphAlone(const GraphChange& change);
120 
122 
134  bool isAlwaysInvalidAlone(const GraphChange& change) const;
135 
137 
139  bool checkEdgeAdditionAlone(NodeId x, NodeId y) const;
140 
142 
143  bool checkEdgeDeletionAlone(NodeId x, NodeId y) const;
144 
146 
149  bool checkModificationAlone(const GraphChange& change) const;
150 
152 
154  bool checkModificationAlone(const EdgeAddition& change) const;
155 
157 
158  bool checkModificationAlone(const EdgeDeletion& change) const;
159 
161 
162 #ifndef DOXYGEN_SHOULD_SKIP_THIS
163 // include the set of methods that enable the structural constraint to
164 // be standalone, i.e., that it needs not be included into a
165 // StructuralConstraintSetStatic to be used by learning algorithms
166 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintUndiGraph
168 # undef GUM_CONSTRAINT_CLASS_NAME
169 #endif // DOXYGEN_SHOULD_SKIP_THIS
170 
171  protected:
174  };
175 
176  } /* namespace learning */
177 
178 } /* namespace gum */
179 
181 #ifndef GUM_NO_INLINE
183 #endif /* GUM_NO_INLINE */
184 
185 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_UNDIGRAPH_H */
void setGraphAlone(const UndiGraph &graph)
sets a new graph from which we will perform checkings
UndiGraph _UndiGraph__graph
the UndiGraph on which we perform checks
the classes to account for structure changes in a graph
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
the base class for all structural constraints
StructuralConstraintUndiGraph & operator=(const StructuralConstraintUndiGraph &from)
copy operator
Base classes for undirected graphs.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The class for notifying learning algorithms of edge removalsThis class is convenient to know at compi...
Definition: graphChange.h:411
The class for notifying learning algorithms of new edge additionsThis class is convenient to know at ...
Definition: graphChange.h:345
the base class for all structural constraints
The base class for structural constraints used by learning algorithms that learn an undirected graph ...
the base class for structural constraints used by learning algorithms that learn an undirected graph ...
void setGraph(Size nb_nodes)
sets a new empty graph from which we will perform checkings
bool checkEdgeDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove edge (x,y)
Base class for undirected graphs.
Definition: undiGraph.h:106
void modifyGraphAlone(const EdgeAddition &change)
notify the constraint of a modification of the graph
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
Size NodeId
Type for node ids.
Definition: graphElements.h:97
bool checkEdgeAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add edge (x,y)