aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
structuralConstraintPatternRootInline.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 // 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) { setGraphAlone(graph); }
35 
36 /// notify the constraint of a modification of the graph
37 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const ArcAddition& change) {
38  modifyGraphAlone(change);
39 }
40 
41 /// notify the constraint of a modification of the graph
42 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const ArcDeletion& change) {
43  modifyGraphAlone(change);
44 }
45 
46 /// notify the constraint of a modification of the graph
47 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const ArcReversal& change) {
48  modifyGraphAlone(change);
49 }
50 
51 /// notify the constraint of a modification of the graph
52 INLINE void GUM_CONSTRAINT_CLASS_NAME::modifyGraph(const GraphChange& change) {
53  modifyGraphAlone(change);
54 }
55 
56 /// checks whether the constraints enable to add arc (x,y)
57 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcAddition(NodeId x, NodeId y) const {
58  return checkArcAdditionAlone(x, y);
59 }
60 
61 /// checks whether the constraints enable to remove arc (x,y)
62 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcDeletion(NodeId x, NodeId y) const {
63  return checkArcDeletionAlone(x, y);
64 }
65 
66 /// checks whether the constraints enable to reverse arc (x,y)
67 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkArcReversal(NodeId x, NodeId y) const {
68  return checkArcReversalAlone(x, y);
69 }
70 
71 /// checks whether the constraints enable to add an arc
72 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcAddition& change) const {
73  return checkModificationAlone(change);
74 }
75 
76 /// checks whether the constraints enable to remove an arc
77 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcDeletion& change) const {
78  return checkModificationAlone(change);
79 }
80 
81 /// checks whether the constraints enable to reverse an arc
82 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkModification(const ArcReversal& change) const {
83  return checkModificationAlone(change);
84 }
85 
86 /// checks whether the constraints enable to perform a graph change
87 INLINE bool GUM_CONSTRAINT_CLASS_NAME::checkModification(const GraphChange& change) const {
88  return checkModificationAlone(change);
89 }
90 
91 /// indicates whether a change will always violate the constraint
92 INLINE bool GUM_CONSTRAINT_CLASS_NAME::isAlwaysInvalid(const GraphChange& change) const {
93  return isAlwaysInvalidAlone(change);
94 }
95 
96 #endif /* GUM_CONSTRAINT_CLASS_NAME */