![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
the "meta-programming" class for storing structural constraintsIn aGrUM, there are two ways to store sets of structural constraints: the first one is to put them into a StructuralConstraintSetDynamic. More...
#include <structuralConstraintSetStatic.h>
Inherits minConstraints< CONSTRAINT1, OTHER_CONSTRAINTS... >.
Public Member Functions | |
Constructors / Destructors | |
StructuralConstraintSetStatic () | |
default constructor More... | |
StructuralConstraintSetStatic (const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > &) | |
copy constructor More... | |
~StructuralConstraintSetStatic () | |
destructor More... | |
Operators | |
StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & | operator= (const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > &) |
copy operator More... | |
Accessors / Modifiers | |
void | setGraph (const DiGraph &graph) |
sets a new graph from which we will perform checkings More... | |
void | modifyGraph (const ArcAddition &change) |
notify the constraint of a modification of the graph More... | |
void | modifyGraph (const ArcDeletion &change) |
notify the constraint of a modification of the graph More... | |
void | modifyGraph (const ArcReversal &change) |
notify the constraint of a modification of the graph More... | |
void | modifyGraph (const GraphChange &change) |
notify the constraint of a modification of the graph More... | |
bool | isAlwaysInvalid (const GraphChange &change) const |
indicates whether a change will always violate the constraint More... | |
bool | checkArcAddition (NodeId x, NodeId y) const |
checks whether the constraints enable to add arc (x,y) More... | |
bool | checkArcDeletion (NodeId x, NodeId y) const |
checks whether the constraints enable to remove arc (x,y) More... | |
bool | checkArcReversal (NodeId x, NodeId y) const |
checks whether the constraints enable to reverse arc (x,y) More... | |
bool | checkModification (const ArcAddition &change) const |
checks whether the constraints enable to add an arc More... | |
bool | checkModification (const ArcDeletion &change) const |
checks whether the constraints enable to remove an arc More... | |
bool | checkModification (const ArcReversal &change) const |
checks whether the constraints enable to reverse an arc More... | |
bool | checkModification (const GraphChange &change) const |
checks whether the constraints enable to perform a graph change More... | |
Public Types | |
using | constraints = typename _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::minConstraints |
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 402 of file structuralConstraintSetStatic.h.
using gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::constraints = typename _StructuralConstraintSetStatic_< CONSTRAINT1, OTHER_CONSTRAINTS... >::minConstraints |
Definition at line 408 of file structuralConstraintSetStatic.h.
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic | ( | ) |
default constructor
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic | ( | const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & | ) |
copy constructor
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::~StructuralConstraintSetStatic | ( | ) |
destructor
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... > & | ) |
copy operator
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::setGraph | ( | const DiGraph & | graph | ) |
sets a new graph from which we will perform checkings