aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS > Class Template Reference

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

Detailed Description

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
class gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >

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.

Member Typedef Documentation

◆ constraints

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
using gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::constraints
Initial value:
typename _StructuralConstraintSetStatic_< CONSTRAINT1,
OTHER_CONSTRAINTS... >::minConstraints

Definition at line 425 of file structuralConstraintSetStatic.h.

Constructor & Destructor Documentation

◆ StructuralConstraintSetStatic() [1/2]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic ( )

default constructor

Referenced by StructuralConstraintSetStatic(), ~StructuralConstraintSetStatic(), and operator=().

Here is the caller graph for this function:

◆ StructuralConstraintSetStatic() [2/2]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::StructuralConstraintSetStatic ( const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & )

copy constructor

References StructuralConstraintSetStatic().

Here is the call graph for this function:

◆ ~StructuralConstraintSetStatic()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::~StructuralConstraintSetStatic ( )

destructor

References StructuralConstraintSetStatic().

Here is the call graph for this function:

Member Function Documentation

◆ checkArcAddition()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcAddition ( NodeId x,
NodeId y ) const

checks whether the constraints enable to add arc (x,y)

◆ checkArcDeletion()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcDeletion ( NodeId x,
NodeId y ) const

checks whether the constraints enable to remove arc (x,y)

◆ checkArcReversal()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkArcReversal ( NodeId x,
NodeId y ) const

checks whether the constraints enable to reverse arc (x,y)

◆ checkModification() [1/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification ( const ArcAddition & change) const

checks whether the constraints enable to add an arc

◆ checkModification() [2/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification ( const ArcDeletion & change) const

checks whether the constraints enable to remove an arc

◆ checkModification() [3/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification ( const ArcReversal & change) const

checks whether the constraints enable to reverse an arc

◆ checkModification() [4/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::checkModification ( const GraphChange & change) const

checks whether the constraints enable to perform a graph change

◆ isAlwaysInvalid()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
bool gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::isAlwaysInvalid ( const GraphChange & change) const

indicates whether a change will always violate the constraint

◆ modifyGraph() [1/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph ( const ArcAddition & change)

notify the constraint of a modification of the graph

◆ modifyGraph() [2/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph ( const ArcDeletion & change)

notify the constraint of a modification of the graph

◆ modifyGraph() [3/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph ( const ArcReversal & change)

notify the constraint of a modification of the graph

◆ modifyGraph() [4/4]

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::modifyGraph ( const GraphChange & change)

notify the constraint of a modification of the graph

◆ operator=()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::operator= ( const StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS... > & )

copy operator

References StructuralConstraintSetStatic().

Here is the call graph for this function:

◆ setGraph()

template<typename CONSTRAINT1, typename... OTHER_CONSTRAINTS>
void gum::learning::StructuralConstraintSetStatic< CONSTRAINT1, OTHER_CONSTRAINTS >::setGraph ( const DiGraph & graph)

sets a new graph from which we will perform checkings


The documentation for this class was generated from the following file: