aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
structuralConstraintPossibleEdges_inl.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /** @file
23  * @brief the structural constraint for forbidding the creation of some arcs
24  * during structure learning
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 namespace gum {
31 
32  namespace learning {
33 
34  /// sets a new graph from which we will perform checkings
36 
37  /// checks whether the constraints enable to add arc (x,y)
41  return res;
42  }
43 
44  /// checks whether the constraints enable to remove arc (x,y)
46  return true;
47  }
48 
49  /// checks whether the constraints enable to reverse arc (x,y)
53  }
54 
55  /// checks whether the constraints enable to add an arc
56  INLINE bool
59  }
60 
61  /// checks whether the constraints enable to remove an arc
62  INLINE bool
65  }
66 
67  /// checks whether the constraints enable to reverse an arc
68  INLINE bool
71  }
72 
73  /// checks whether the constraints enable to perform a graph change
74  INLINE bool
76  switch (change.type()) {
79 
82 
85 
86  default:
88  "edge modifications are not "
89  "supported by StructuralConstraintPossibleEdges");
90  }
91  }
92 
93  /// notify the constraint of a modification of the graph
95 
96  /// notify the constraint of a modification of the graph
98 
99  /// notify the constraint of a modification of the graph
101 
102  /// notify the constraint of a modification of the graph
104 
105  /// indicates whether a change will always violate the constraint
106  INLINE bool
108  switch (change.type()) {
111 
113  return false;
114 
117 
118  default:
120  "edge modifications are not supported "
121  "by StructuralConstraintPossibleEdges");
122  }
123  }
124 
125  /// assign a set of forbidden edge
128  }
129 
130  /// assign a new forbidden edge
133  }
134 
135  /// remove a forbidden edge
138  }
139 
140  /// returns the set of possible edges
143  }
144 
145 // include all the methods applicable to the whole class hierarchy
146 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintPossibleEdges
147 # include <agrum/BN/learning/constraints/structuralConstraintPatternRootInline.h>
148 # undef GUM_CONSTRAINT_CLASS_NAME
149 
150  } /* namespace learning */
151 
152 } /* namespace gum */
153 
154 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)