![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
the "meta-programming" class for storing structural constraints More...
#include <structuralConstraintSetStatic.h>
Inherits _StructuralConstraintSetStatic_::minConstraints.
Public Types | |
| using | constraints |
Public Member Functions | |
Constructors / Destructors | |
| StructuralConstraintSetStatic () | |
| default constructor | |
| StructuralConstraintSetStatic (const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > &) | |
| copy constructor | |
| ~StructuralConstraintSetStatic () | |
| destructor | |
Operators | |
| StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & | operator= (const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > &) |
| copy operator | |
Accessors / Modifiers | |
| void | setGraph (const DiGraph &graph) |
| sets a new graph from which we will perform checkings | |
| void | modifyGraph (const ArcAddition &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraph (const ArcDeletion &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraph (const ArcReversal &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraph (const GraphChange &change) |
| notify the constraint of a modification of the graph | |
| bool | isAlwaysInvalid (const GraphChange &change) const |
| indicates whether a change will always violate the constraint | |
| bool | checkArcAddition (NodeId x, NodeId y) const |
| checks whether the constraints enable to add arc (x,y) | |
| bool | checkArcDeletion (NodeId x, NodeId y) const |
| checks whether the constraints enable to remove arc (x,y) | |
| bool | checkArcReversal (NodeId x, NodeId y) const |
| checks whether the constraints enable to reverse arc (x,y) | |
| bool | checkModification (const ArcAddition &change) const |
| checks whether the constraints enable to add an arc | |
| bool | checkModification (const ArcDeletion &change) const |
| checks whether the constraints enable to remove an arc | |
| bool | checkModification (const ArcReversal &change) const |
| checks whether the constraints enable to reverse an arc | |
| bool | checkModification (const GraphChange &change) const |
| checks whether the constraints enable to perform a graph change | |
the "meta-programming" class for storing structural constraints
In aGrUM, there are two ways to store sets of structural constraints: the first one is to put them into a StructuralConstraintSetDynamic. This class allows to add at runtime any constraint you wish. As such, it is very generic but, by not knowing at compile time the constraints that will be stored into the vector, calling its methods has a slight overhead. On the other hand, if you already know all the constraints you wish to apply, the StructuralConstraintSetStatic is better suited because it will compute at compile time how to call the constraint's methods in a most efficient way: if these methods are inlined, there will be no overhead at all when calling these methods.
This class is intended to store structural constraints and help applying them during learning in a most efficient way. The idea is that it will compute at compile time the class hierarchy graph of the set of constraints and will determine the set of distinct structural constraints in the set. Then, each time we wish to apply a method, say a graph modification check to all the constraints, the class will apply the methods once on each distinct constraint, hence avoiding duplicates.
Definition at line 421 of file structuralConstraintSetStatic.h.
| using gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::constraints |
Definition at line 425 of file structuralConstraintSetStatic.h.
| gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic | ( | ) |
default constructor
Referenced by StructuralConstraintSetStatic(), ~StructuralConstraintSetStatic(), and operator=().
| gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic | ( | const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & | ) |
copy constructor
References StructuralConstraintSetStatic().
| gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::~StructuralConstraintSetStatic | ( | ) |
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcAddition | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to add arc (x,y)
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcDeletion | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to remove arc (x,y)
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcReversal | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to reverse arc (x,y)
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification | ( | const ArcAddition & | change | ) | const |
checks whether the constraints enable to add an arc
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification | ( | const ArcDeletion & | change | ) | const |
checks whether the constraints enable to remove an arc
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification | ( | const ArcReversal & | change | ) | const |
checks whether the constraints enable to reverse an arc
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification | ( | const GraphChange & | change | ) | const |
checks whether the constraints enable to perform a graph change
| bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::isAlwaysInvalid | ( | const GraphChange & | change | ) | const |
indicates whether a change will always violate the constraint
| void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph | ( | const ArcAddition & | change | ) |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph | ( | const ArcDeletion & | change | ) |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph | ( | const ArcReversal & | change | ) |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph | ( | const GraphChange & | change | ) |
notify the constraint of a modification of the graph
| StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::operator= | ( | const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & | ) |
| void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::setGraph | ( | const DiGraph & | graph | ) |
sets a new graph from which we will perform checkings