![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
the structural constraint for forbidding the creation of some arcs during structure learning More...
#include <structuralConstraintForbiddenArcs.h>
Public Types | |
| using | allConstraints = _ConstraintSet_< void > |
Public Member Functions | |
Constructors / Destructors | |
| StructuralConstraintForbiddenArcs () | |
| default constructor | |
| StructuralConstraintForbiddenArcs (const DiGraph &graph) | |
| constructor starting with a given graph | |
| StructuralConstraintForbiddenArcs (const StructuralConstraintForbiddenArcs &from) | |
| copy constructor | |
| StructuralConstraintForbiddenArcs (StructuralConstraintForbiddenArcs &&from) | |
| move constructor | |
| virtual | ~StructuralConstraintForbiddenArcs () |
| destructor | |
Operators | |
| StructuralConstraintForbiddenArcs & | operator= (const StructuralConstraintForbiddenArcs &from) |
| copy operator | |
| StructuralConstraintForbiddenArcs & | operator= (StructuralConstraintForbiddenArcs &&from) |
| move operator | |
Specific Accessors / Modifiers | |
| void | setArcs (const ArcSet &set) |
| assign a set of forbidden arcs | |
| void | addArc (const Arc &arc) |
| assign a new forbidden arc | |
| void | eraseArc (const Arc &arc) |
| remove a forbidden arc | |
| const ArcSet & | arcs () const |
| returns the set of mandatory arcs | |
| void | setGraphAlone (const DiGraph &graph) |
| sets a new graph from which we will perform checkings | |
| void | modifyGraphAlone (const ArcAddition &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraphAlone (const ArcDeletion &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraphAlone (const ArcReversal &change) |
| notify the constraint of a modification of the graph | |
| void | modifyGraphAlone (const GraphChange &change) |
| notify the constraint of a modification of the graph | |
| bool | isAlwaysInvalidAlone (const GraphChange &change) const |
| indicates whether a change will always violate the constraint | |
| bool | checkArcAdditionAlone (NodeId x, NodeId y) const |
| checks whether the constraints enable to add arc (x,y) | |
| bool | checkArcDeletionAlone (NodeId x, NodeId y) const |
| checks whether the constraints enable to remove arc (x,y) | |
| bool | checkArcReversalAlone (NodeId x, NodeId y) const |
| checks whether the constraints enable to reverse arc (x,y) | |
| bool | checkModificationAlone (const GraphChange &change) const |
| checks whether the constraints enable to perform a graph change | |
| bool | checkModificationAlone (const ArcAddition &change) const |
| checks whether the constraints enable to add an arc | |
| bool | checkModificationAlone (const ArcDeletion &change) const |
| checks whether the constraints enable to remove an arc | |
| bool | checkModificationAlone (const ArcReversal &change) const |
| checks whether the constraints enable to reverse an arc | |
Protected Attributes | |
| ArcSet | _ForbiddenArcs_forbidden_arcs_ |
| the ForbiddenArcs on which we perform checks | |
the structural constraint for forbidding the creation of some arcs during structure learning
Definition at line 64 of file structuralConstraintForbiddenArcs.h.
|
inherited |
Definition at line 61 of file structuralConstraint.h.
| gum::learning::StructuralConstraintForbiddenArcs::StructuralConstraintForbiddenArcs | ( | ) |
default constructor
Definition at line 61 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs().
Referenced by StructuralConstraintForbiddenArcs(), StructuralConstraintForbiddenArcs(), StructuralConstraintForbiddenArcs(), StructuralConstraintForbiddenArcs(), ~StructuralConstraintForbiddenArcs(), operator=(), and operator=().
| gum::learning::StructuralConstraintForbiddenArcs::StructuralConstraintForbiddenArcs | ( | const DiGraph & | graph | ) |
constructor starting with a given graph
Definition at line 66 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs().
| gum::learning::StructuralConstraintForbiddenArcs::StructuralConstraintForbiddenArcs | ( | const StructuralConstraintForbiddenArcs & | from | ) |
copy constructor
Definition at line 72 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs(), and _ForbiddenArcs_forbidden_arcs_.
| gum::learning::StructuralConstraintForbiddenArcs::StructuralConstraintForbiddenArcs | ( | StructuralConstraintForbiddenArcs && | from | ) |
move constructor
Definition at line 79 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs(), and _ForbiddenArcs_forbidden_arcs_.
|
virtual |
destructor
Definition at line 86 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs().
| void gum::learning::StructuralConstraintForbiddenArcs::addArc | ( | const Arc & | arc | ) |
assign a new forbidden arc
| const ArcSet & gum::learning::StructuralConstraintForbiddenArcs::arcs | ( | ) | const |
returns the set of mandatory arcs
| bool gum::learning::StructuralConstraintForbiddenArcs::checkArcAdditionAlone | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to add arc (x,y)
an arc can be added if and only if its extremal nodes belong to the graph and the arc does not already exist.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkArcDeletionAlone | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to remove arc (x,y)
an arc can be removed if and only if the arc exists.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkArcReversalAlone | ( | NodeId | x, |
| NodeId | y ) const |
checks whether the constraints enable to reverse arc (x,y)
an arc can be reversed if and only if it exists and arc (y,x) does not.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkModificationAlone | ( | const ArcAddition & | change | ) | const |
checks whether the constraints enable to add an arc
an arc can be added if and only if its extremal nodes belong to the graph and the arc does not already exist.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkModificationAlone | ( | const ArcDeletion & | change | ) | const |
checks whether the constraints enable to remove an arc
an arc can be removed if and only if the arc exists.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkModificationAlone | ( | const ArcReversal & | change | ) | const |
checks whether the constraints enable to reverse an arc
an arc (x,y) can be reversed if and only if it exists and arc (y,x) does not.
| bool gum::learning::StructuralConstraintForbiddenArcs::checkModificationAlone | ( | const GraphChange & | change | ) | const |
checks whether the constraints enable to perform a graph change
An arc can be added if and only if its extremal nodes belong to the graph and the arc does not already exist. An arc can be removed if and only if the arc exists. An arc (x,y) can be reversed if and only if it exists and arc (y,x) does not.
| void gum::learning::StructuralConstraintForbiddenArcs::eraseArc | ( | const Arc & | arc | ) |
remove a forbidden arc
| bool gum::learning::StructuralConstraintForbiddenArcs::isAlwaysInvalidAlone | ( | const GraphChange & | change | ) | const |
indicates whether a change will always violate the constraint
Some learning algorithms need examine several times whether a given graph change can be applied. For instance, the first time arc (X,Y) addition is considered, the learning algorithm may discard this change because it violates the structural constraint (e.g., if the latter enforces a DAG structure, this arc addition might induce a directed cycle), but, later on, other arc removal may induce that the arc addition is now possible. Such change is thus not always invalid. Conversely, there are changes that can be discarded once and for all. For instance, in a 2TBN structure, it is always impossible to add a backward-time arc. Such graph changes are always invalid and are therefore tagged as such by the isAlwaysInvalid method.
| void gum::learning::StructuralConstraintForbiddenArcs::modifyGraphAlone | ( | const ArcAddition & | change | ) |
notify the constraint of a modification of the graph
| InvalidNode | exception is thrown if an arc (x,y) is added and x or y does not belong to the graph nodes |
| void gum::learning::StructuralConstraintForbiddenArcs::modifyGraphAlone | ( | const ArcDeletion & | change | ) |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintForbiddenArcs::modifyGraphAlone | ( | const ArcReversal & | change | ) |
notify the constraint of a modification of the graph
| InvalidNode | exception is thrown if at least one extremity of the arc does not belong to the graph nodes |
| void gum::learning::StructuralConstraintForbiddenArcs::modifyGraphAlone | ( | const GraphChange & | change | ) |
notify the constraint of a modification of the graph
| InvalidNode | exception is thrown if an arc (x,y) is added and x or y does not belong to the graph nodes |
| StructuralConstraintForbiddenArcs & gum::learning::StructuralConstraintForbiddenArcs::operator= | ( | const StructuralConstraintForbiddenArcs & | from | ) |
copy operator
Definition at line 91 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs(), and _ForbiddenArcs_forbidden_arcs_.
| StructuralConstraintForbiddenArcs & gum::learning::StructuralConstraintForbiddenArcs::operator= | ( | StructuralConstraintForbiddenArcs && | from | ) |
move operator
Definition at line 99 of file structuralConstraintForbiddenArcs.cpp.
References StructuralConstraintForbiddenArcs(), and _ForbiddenArcs_forbidden_arcs_.
| void gum::learning::StructuralConstraintForbiddenArcs::setArcs | ( | const ArcSet & | set | ) |
assign a set of forbidden arcs
| void gum::learning::StructuralConstraintForbiddenArcs::setGraphAlone | ( | const DiGraph & | graph | ) |
sets a new graph from which we will perform checkings
|
protected |
the ForbiddenArcs on which we perform checks
Definition at line 212 of file structuralConstraintForbiddenArcs.h.
Referenced by StructuralConstraintForbiddenArcs(), StructuralConstraintForbiddenArcs(), operator=(), and operator=().