![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
the structural constraint imposing a partial order over nodes More...
#include <structuralConstraintSliceOrder.h>
Public Member Functions | |
Constructors / Destructors | |
| StructuralConstraintSliceOrder () | |
| default constructor | |
| StructuralConstraintSliceOrder (const NodeProperty< NodeId > &order) | |
| constructor starting with an empty graph with a given number of nodes | |
| StructuralConstraintSliceOrder (const DiGraph &graph, const NodeProperty< NodeId > &order) | |
| constructor starting with a given graph | |
| StructuralConstraintSliceOrder (const StructuralConstraintSliceOrder &from) | |
| copy constructor | |
| StructuralConstraintSliceOrder (StructuralConstraintSliceOrder &&from) | |
| move constructor | |
| virtual | ~StructuralConstraintSliceOrder () |
| destructor | |
Operators | |
| StructuralConstraintSliceOrder & | operator= (const StructuralConstraintSliceOrder &from) |
| copy operator | |
| StructuralConstraintSliceOrder & | operator= (StructuralConstraintSliceOrder &&from) |
| move operator | |
Specific Accessors / Modifiers | |
| void | setSliceOrder (const NodeProperty< NodeId > &slice) |
| sets the time slices of all the nodes in the property | |
| const NodeProperty< NodeId > & | sliceOrder () const |
| returns the current slice order | |
| void | addNode (NodeId node, NodeId slice) |
| adds a new node in the slice order | |
| void | setDefaultSlice (NodeId slice) |
| assign a given slice to all the nodes specified in the partial order | |
| 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 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 | |
| bool | checkModificationAlone (const GraphChange &change) const |
| checks whether the constraints enable to perform a graph change | |
Protected Types | |
| using | constraints |
Protected Member Functions | |
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 | |
| 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 | |
Protected Attributes | |
| NodeProperty< NodeId > | _SliceOrder_order_ |
| slices to which belong the nodes | |
the structural constraint imposing a partial order over nodes
In DBNs, it is forbidden to add arcs from nodes at time slice t to nodes at time slice s, where s < t. This class allows for taking this kind of constraint into account by imposing a partial order over the nodes: arcs (X,Y) can then only be added if X <= Y in the partial order.
Definition at line 86 of file structuralConstraintSliceOrder.h.
|
inherited |
Definition at line 425 of file structuralConstraintSetStatic.h.
| gum::learning::StructuralConstraintSliceOrder::StructuralConstraintSliceOrder | ( | ) |
default constructor
Definition at line 71 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder().
Referenced by StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), ~StructuralConstraintSliceOrder(), operator=(), and operator=().
| gum::learning::StructuralConstraintSliceOrder::StructuralConstraintSliceOrder | ( | const NodeProperty< NodeId > & | order | ) |
constructor starting with an empty graph with a given number of nodes
param order the partial order
Definition at line 76 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), _SliceOrder_order_, gum::HashTable< Key, Val >::cbegin(), and gum::HashTable< Key, Val >::cend().
| gum::learning::StructuralConstraintSliceOrder::StructuralConstraintSliceOrder | ( | const DiGraph & | graph, |
| const NodeProperty< NodeId > & | order ) |
constructor starting with a given graph
Definition at line 87 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), and _SliceOrder_order_.
| gum::learning::StructuralConstraintSliceOrder::StructuralConstraintSliceOrder | ( | const StructuralConstraintSliceOrder & | from | ) |
copy constructor
Definition at line 95 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), and _SliceOrder_order_.
| gum::learning::StructuralConstraintSliceOrder::StructuralConstraintSliceOrder | ( | StructuralConstraintSliceOrder && | from | ) |
move constructor
Definition at line 102 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), and _SliceOrder_order_.
|
virtual |
destructor
Definition at line 110 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder().
adds a new node in the slice order
|
inherited |
checks whether the constraints enable to add arc (x,y)
| bool gum::learning::StructuralConstraintSliceOrder::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 and is not a backward-time arc.
|
inherited |
checks whether the constraints enable to remove arc (x,y)
| bool gum::learning::StructuralConstraintSliceOrder::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.
|
inherited |
checks whether the constraints enable to reverse arc (x,y)
| bool gum::learning::StructuralConstraintSliceOrder::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 and is not a backward-time arc.
|
inherited |
checks whether the constraints enable to add an arc
| bool gum::learning::StructuralConstraintSliceOrder::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 and is not a backward-time arc.
| bool gum::learning::StructuralConstraintSliceOrder::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::StructuralConstraintSliceOrder::checkModificationAlone | ( | const ArcReversal & | change | ) | const |
checks whether the constraints enable to reverse an arc
an arc can be reversed if and only if it exists and arc (y,x) does not and is not a backward-time arc.
| bool gum::learning::StructuralConstraintSliceOrder::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 and is not a backward-time arc. 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 and is not a backward-time arc.
|
inherited |
indicates whether a change will always violate the constraint
| bool gum::learning::StructuralConstraintSliceOrder::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.
|
inherited |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintSliceOrder::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 |
| InvalidArc | exception is thrown if any time-backward arc is created by the arc addition. |
| void gum::learning::StructuralConstraintSliceOrder::modifyGraphAlone | ( | const ArcDeletion & | change | ) |
notify the constraint of a modification of the graph
| void gum::learning::StructuralConstraintSliceOrder::modifyGraphAlone | ( | const ArcReversal & | 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 |
| InvalidArc | exception is thrown if any time-backward arc is created by the arc reversal. |
| void gum::learning::StructuralConstraintSliceOrder::modifyGraphAlone | ( | const GraphChange & | change | ) |
notify the constraint of a modification of the graph
| InvalidNode | exception is thrown if an arc (x,y) is added or reversed and x or y does not belong to the graph nodes |
| InvalidArc | exception is thrown if any time-backward arc is created by an arc addition or reversal. |
| StructuralConstraintSliceOrder & gum::learning::StructuralConstraintSliceOrder::operator= | ( | const StructuralConstraintSliceOrder & | from | ) |
copy operator
Definition at line 116 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), _SliceOrder_order_, and gum::learning::StructuralConstraintDiGraph::operator=().
| StructuralConstraintSliceOrder & gum::learning::StructuralConstraintSliceOrder::operator= | ( | StructuralConstraintSliceOrder && | from | ) |
move operator
Definition at line 126 of file structuralConstraintSliceOrder.cpp.
References StructuralConstraintSliceOrder(), _SliceOrder_order_, and gum::learning::StructuralConstraintDiGraph::operator=().
| void gum::learning::StructuralConstraintSliceOrder::setDefaultSlice | ( | NodeId | slice | ) |
assign a given slice to all the nodes specified in the partial order
|
inherited |
sets a new graph from which we will perform checkings
| void gum::learning::StructuralConstraintSliceOrder::setGraphAlone | ( | const DiGraph & | graph | ) |
sets a new graph from which we will perform checkings
| void gum::learning::StructuralConstraintSliceOrder::setSliceOrder | ( | const NodeProperty< NodeId > & | slice | ) |
sets the time slices of all the nodes in the property
| const NodeProperty< NodeId > & gum::learning::StructuralConstraintSliceOrder::sliceOrder | ( | ) | const |
returns the current slice order
|
protected |
slices to which belong the nodes
Definition at line 249 of file structuralConstraintSliceOrder.h.
Referenced by StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), StructuralConstraintSliceOrder(), operator=(), and operator=().