![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes elimination sequence, that is, the set of all the nodes is divided into several subsets. More...
#include <partialOrderedEliminationSequenceStrategy.h>
Public Member Functions | |
Accessors / Modifiers | |
virtual bool | setGraph (UndiGraph *graph, const NodeProperty< Size > *dom_sizes) |
sets a new graph to be triangulated More... | |
virtual bool | setPartialOrder (const List< NodeSet > *subsets) |
sets a new partial ordering constraint on the elimination sequence More... | |
virtual void | clear () |
clears the sequence (to prepare, for instance, a new elimination sequence) More... | |
const List< NodeSet > * | partialOrder () const noexcept |
returns the current partial ordering More... | |
bool | isPartialOrderNeeded () const noexcept |
indicates if a new partial ordering is needed More... | |
Accessors / Modifiers | |
virtual NodeId | nextNodeToEliminate ()=0 |
returns the new node to be eliminated within the triangulation algorithm More... | |
virtual void | askFillIns (bool do_it)=0 |
if the elimination sequence is able to compute fill-ins, we indicate whether we want this feature to be activated More... | |
virtual bool | providesFillIns () const =0 |
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the elimination sequence, or need be computed by the triangulation itself. More... | |
virtual bool | providesGraphUpdate () const =0 |
indicates whether the elimination sequence updates by itself the graph after a node has been eliminated More... | |
virtual void | eliminationUpdate (const NodeId node) |
performs all the graph/fill-ins updates provided (if any) More... | |
virtual const EdgeSet & | fillIns () |
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so far More... | |
UndiGraph * | graph () const noexcept |
returns the current graph More... | |
const NodeProperty< Size > * | domainSizes () const noexcept |
returns the current domain sizes More... | |
Protected Attributes | |
const List< NodeSet > * | subsets_ {nullptr} |
the subsets constituting the partial ordering More... | |
List< NodeSet >::const_iterator | subset_iter_ |
the iterator indicating which is the current subset on which we work More... | |
NodeSet | nodeset_ |
the nodes which can be currently eliminated More... | |
bool | partial_order_needed_ {true} |
indicate whether a new partial ordering is necessary for the elimination More... | |
UndiGraph * | graph_ {nullptr} |
the graph to be triangulated More... | |
const NodeProperty< Size > * | domain_sizes_ {nullptr} |
the domain sizes of the variables/nodes More... | |
NodeProperty< double > | log_domain_sizes_ |
the log of the domain sizes of the variables/nodes More... | |
Protected Member Functions | |
bool | isPartialOrderNeeded_ (const List< NodeSet > *subsets) const |
indicate whether a partial ordering is compatible with the current graph More... | |
Constructors / Destructors | |
virtual | ~PartialOrderedEliminationSequenceStrategy () |
destructor More... | |
virtual PartialOrderedEliminationSequenceStrategy * | newFactory () const =0 |
creates a new elimination sequence of the same type as the current object, but this sequence contains only an empty graph More... | |
virtual PartialOrderedEliminationSequenceStrategy * | copyFactory () const =0 |
virtual copy constructor More... | |
PartialOrderedEliminationSequenceStrategy () | |
default constructor (uses an empty graph) More... | |
PartialOrderedEliminationSequenceStrategy (UndiGraph *graph, const NodeProperty< Size > *dom_sizes, const List< NodeSet > *subsets) | |
constructor for an a priori non empty graph More... | |
PartialOrderedEliminationSequenceStrategy (const PartialOrderedEliminationSequenceStrategy &) | |
copy constructor More... | |
PartialOrderedEliminationSequenceStrategy (PartialOrderedEliminationSequenceStrategy &&) | |
move constructor More... | |
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes elimination sequence, that is, the set of all the nodes is divided into several subsets.
Within each subset, any ordering can be chosen. But all the nodes of the first subset must be eliminated before the nodes of the second, which must be eliminated before those of the third subset, and so on.
Definition at line 54 of file partialOrderedEliminationSequenceStrategy.h.
|
virtual |
destructor
Definition at line 82 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
default constructor (uses an empty graph)
default constructor
Definition at line 42 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
constructor for an a priori non empty graph
graph | the graph to be triangulated, i.e., the nodes of which will be eliminated |
dom_sizes | thedomain sizes of the nodes/variables |
subsets | the list of the subsets constituting the partial ordering |
Definition at line 48 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
copy constructor
Definition at line 60 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
move constructor
Definition at line 70 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
pure virtualinherited |
if the elimination sequence is able to compute fill-ins, we indicate whether we want this feature to be activated
do_it | when true and the elimination sequence has the ability to compute fill-ins, the elimination sequence will actually compute them (for the triangulation to use them), else they will not be available. |
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
|
virtual |
clears the sequence (to prepare, for instance, a new elimination sequence)
Reimplemented from gum::EliminationSequenceStrategy.
Reimplemented in gum::DefaultPartialOrderedEliminationSequenceStrategy.
Definition at line 138 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
pure virtual |
virtual copy constructor
Implements gum::EliminationSequenceStrategy.
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy.
|
noexceptinherited |
returns the current domain sizes
Definition at line 40 of file eliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
performs all the graph/fill-ins updates provided (if any)
node | the node the elimination of which requires the graph update |
Reimplemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
Definition at line 91 of file eliminationSequenceStrategy.cpp.
|
virtualinherited |
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so far
Reimplemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
Definition at line 95 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
noexceptinherited |
returns the current graph
Definition at line 36 of file eliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
indicates if a new partial ordering is needed
if the current partial ordering does not contain all the nodes of the graph or if the graph itself is not defined (nullptr) a new partial ordering will be needed for the next triangulation
Definition at line 44 of file partialOrderedEliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
protected |
indicate whether a partial ordering is compatible with the current graph
The method checks whether all the nodes of the graph belong to the partial ordering.
Definition at line 99 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
pure virtual |
creates a new elimination sequence of the same type as the current object, but this sequence contains only an empty graph
Implements gum::EliminationSequenceStrategy.
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy.
|
pure virtualinherited |
returns the new node to be eliminated within the triangulation algorithm
NotFound | exception is thrown if there is no more node to eliminate in the graph |
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
|
noexcept |
returns the current partial ordering
Definition at line 38 of file partialOrderedEliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
pure virtualinherited |
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the elimination sequence, or need be computed by the triangulation itself.
An elimination sequence provides fill-ins to its triangulation if and only if it has the ability to compute them and it has been asked to do so (by method askFillIns)
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
|
pure virtualinherited |
indicates whether the elimination sequence updates by itself the graph after a node has been eliminated
Some algorithms have more informations than the triangulation algorithm to update the graph after a node has been eliminated. They can thus exploit these informations to update the graph faster than the triangulation itself. Hence the latter should delegate this operation to the elimination sequence. This is the case, for instance, for the defaultEliminationSequenceStrategy, which uses a SimplicialSet that knows that some eliminated nodes do not require any fill-in.
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, and gum::OrderedEliminationSequenceStrategy.
|
virtual |
sets a new graph to be triangulated
The elimination sequence algorithms reinitializes its data to start a new triangulation with graph Graph
graph | the new graph to be triangulated |
dom_sizes | the domain sizes of the nodes/variables |
Reimplemented from gum::EliminationSequenceStrategy.
Reimplemented in gum::DefaultPartialOrderedEliminationSequenceStrategy.
Definition at line 89 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
sets a new partial ordering constraint on the elimination sequence
sets a new partial order
subsets | the list of the subsets constituting the partial ordering |
Definition at line 116 of file partialOrderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
the domain sizes of the variables/nodes
Definition at line 158 of file eliminationSequenceStrategy.h.
|
protectedinherited |
the graph to be triangulated
Definition at line 155 of file eliminationSequenceStrategy.h.
|
protectedinherited |
the log of the domain sizes of the variables/nodes
Definition at line 161 of file eliminationSequenceStrategy.h.
|
protected |
the nodes which can be currently eliminated
Definition at line 133 of file partialOrderedEliminationSequenceStrategy.h.
|
protected |
indicate whether a new partial ordering is necessary for the elimination
Definition at line 136 of file partialOrderedEliminationSequenceStrategy.h.
|
protected |
the iterator indicating which is the current subset on which we work
Definition at line 130 of file partialOrderedEliminationSequenceStrategy.h.
the subsets constituting the partial ordering
Definition at line 127 of file partialOrderedEliminationSequenceStrategy.h.