aGrUM  0.14.2
structuralConstraintForbiddenArcs.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_FORBIDDEN_ARCS_H
27 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_FORBIDDEN_ARCS_H
28 
29 #include <agrum/agrum.h>
30 #include <agrum/graphs/diGraph.h>
33 
34 namespace gum {
35 
36  namespace learning {
37 
44  : public virtual StructuralConstraintEmpty {
45  public:
46  // ##########################################################################
48  // ##########################################################################
50 
53 
56 
60 
63 
66 
68 
69  // ##########################################################################
71  // ##########################################################################
73 
77 
81 
83 
84  // ##########################################################################
86  // ##########################################################################
88 
90  void setArcs(const ArcSet& set);
91 
93  void addArc(const Arc& arc);
94 
96  void eraseArc(const Arc& arc);
97 
99  const ArcSet& arcs() const;
100 
102  void setGraphAlone(const DiGraph& graph);
103 
105 
109  void modifyGraphAlone(const ArcAddition& change);
110 
112 
114  void modifyGraphAlone(const ArcDeletion& change);
115 
117 
121  void modifyGraphAlone(const ArcReversal& change);
122 
124 
128  void modifyGraphAlone(const GraphChange& change);
129 
131 
144  bool isAlwaysInvalidAlone(const GraphChange& change) const;
145 
147 
149  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
150 
152 
153  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
154 
156 
158  bool checkArcReversalAlone(NodeId x, NodeId y) const;
159 
161 
166  bool checkModificationAlone(const GraphChange& change) const;
167 
169 
171  bool checkModificationAlone(const ArcAddition& change) const;
172 
174 
175  bool checkModificationAlone(const ArcDeletion& change) const;
176 
178 
180  bool checkModificationAlone(const ArcReversal& change) const;
181 
183 
184 #ifndef DOXYGEN_SHOULD_SKIP_THIS
185 // include the set of methods that enable the structural constraint to
186 // be standalone, i.e., that it needs not be included into a
187 // StructuralConstraintSetStatic to be used by learning algorithms
188 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintForbiddenArcs
190 # undef GUM_CONSTRAINT_CLASS_NAME
191 #endif // DOXYGEN_SHOULD_SKIP_THIS
192 
193  protected:
196  };
197 
198  } /* namespace learning */
199 
200 } /* namespace gum */
201 
203 #ifndef GUM_NO_INLINE
205 #endif /* GUM_NO_INLINE */
206 
207 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_FORBIDDEN_ARCS_H */
Base classes for oriented graphs.
the structural constraint for forbidding the creation of some arcs during structure learning ...
void addArc(const Arc &arc)
assign a new forbidden arc
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
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:213
the base class for all structural constraints
void setArcs(const ArcSet &set)
assign a set of forbidden arcs
gum is the global namespace for all aGrUM entities
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
the base class for all structural constraints
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
Base class for all oriented graphs.
Definition: diGraph.h:108
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:279
void modifyGraphAlone(const ArcAddition &change)
notify the constraint of a modification of the graph
the structural constraint for forbidding the creation of some arcs during structure learning ...
Size NodeId
Type for node ids.
Definition: graphElements.h:97
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)