aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
structuralConstraintPattern4UndiGraphRootInline.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 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 // this file should be included at the end of the StructuralConstraints inline
23 // files (see StructuralConstraintUndiGraph to see how it should be included).
24 // This concerns only StructuralConstraints that do not derive from other
25 // StructuralConstraints, i.e., that do not derive from public virtual
26 // StructuralConstraintSetStatic<...>. Such a class is
27 // StructuralConstraintUndiGraph.
28 // If your class derives from anoter constraint, include file
29 // StructuralConstraintPattern4UndiGraphInline.h instead.
30 
31 #ifdef GUM_CONSTRAINT_CLASS_NAME
32 
33 /// sets a new graph from which we will perform checkings
34 INLINE void GUM_CONSTRAINT_CLASS_NAME::setGraph(const UndiGraph& graph) {
35  setGraphAlone(graph);
36 }
37 
38 /// notify the constraint of a modification of the graph
39 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const EdgeAddition& change) {
40  modifyGraphAlone(change);
41 }
42 
43 /// notify the constraint of a modification of the graph
44 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const EdgeDeletion& change) {
45  modifyGraphAlone(change);
46 }
47 
48 /// notify the constraint of a modification of the graph
49 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const GraphChange& change) {
50  modifyGraphAlone(change);
51 }
52 
53 /// checks whether the constraints enable to add arc (x,y)
54 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkEdgeAddition(NodeId x,
55  NodeId y) const {
56  return checkEdgeAdditionAlone(x, y);
57 }
58 
59 /// checks whether the constraints enable to remove arc (x,y)
60 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkEdgeDeletion(NodeId x,
61  NodeId y) const {
62  return checkEdgeDeletionAlone(x, y);
63 }
64 
65 /// checks whether the constraints enable to add an arc
66 INLINE bool
67  GUM_CONSTRAINT_CLASS_NAME::checkModification(const EdgeAddition& change) const {
68  return checkModificationAlone(change);
69 }
70 
71 /// checks whether the constraints enable to remove an arc
72 INLINE bool
73  GUM_CONSTRAINT_CLASS_NAME::checkModification(const EdgeDeletion& change) const {
74  return checkModificationAlone(change);
75 }
76 
77 /// checks whether the constraints enable to perform a graph change
78 INLINE bool
79  GUM_CONSTRAINT_CLASS_NAME::checkModification(const GraphChange& change) const {
80  return checkModificationAlone(change);
81 }
82 
83 /// indicates whether a change will always violate the constraint
84 INLINE bool
85  GUM_CONSTRAINT_CLASS_NAME::isAlwaysInvalid(const GraphChange& change) const {
86  return isAlwaysInvalidAlone(change);
87 }
88 
89 #endif /* GUM_CONSTRAINT_CLASS_NAME */