aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
structuralConstraintPatternRootInline.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 StructuralConstraintDiGraph 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 // StructuralConstraintDiGraph.
28 // If your class derives from anoter constraint, include file
29 // StructuralConstraintPatternInline.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 DiGraph& 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 ArcAddition& 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 ArcDeletion& 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 ArcReversal& change) {
50  modifyGraphAlone(change);
51 }
52 
53 /// notify the constraint of a modification of the graph
54 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const GraphChange& change) {
55  modifyGraphAlone(change);
56 }
57 
58 /// checks whether the constraints enable to add arc (x,y)
59 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcAddition(NodeId x, NodeId y) const {
60  return checkArcAdditionAlone(x, y);
61 }
62 
63 /// checks whether the constraints enable to remove arc (x,y)
64 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcDeletion(NodeId x, NodeId y) const {
65  return checkArcDeletionAlone(x, y);
66 }
67 
68 /// checks whether the constraints enable to reverse arc (x,y)
69 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcReversal(NodeId x, NodeId y) const {
70  return checkArcReversalAlone(x, y);
71 }
72 
73 /// checks whether the constraints enable to add an arc
74 INLINE bool
75  GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcAddition& change) const {
76  return checkModificationAlone(change);
77 }
78 
79 /// checks whether the constraints enable to remove an arc
80 INLINE bool
81  GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcDeletion& change) const {
82  return checkModificationAlone(change);
83 }
84 
85 /// checks whether the constraints enable to reverse an arc
86 INLINE bool
87  GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcReversal& change) const {
88  return checkModificationAlone(change);
89 }
90 
91 /// checks whether the constraints enable to perform a graph change
92 INLINE bool
93  GUM_CONSTRAINT_CLASS_NAME::checkModification(const GraphChange& change) const {
94  return checkModificationAlone(change);
95 }
96 
97 /// indicates whether a change will always violate the constraint
98 INLINE bool
99  GUM_CONSTRAINT_CLASS_NAME::isAlwaysInvalid(const GraphChange& change) const {
100  return isAlwaysInvalidAlone(change);
101 }
102 
103 #endif /* GUM_CONSTRAINT_CLASS_NAME */