![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
The base class for all elimination sequence algorithms used by triangulation algorithms. More...
#include <eliminationSequenceStrategy.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 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... | |
virtual void | clear () |
clears the sequence (to prepare, for instance, a new elimination sequence) More... | |
UndiGraph * | graph () const noexcept |
returns the current graph More... | |
const NodeProperty< Size > * | domainSizes () const noexcept |
returns the current domain sizes More... | |
Protected Attributes | |
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... | |
Constructors / Destructors | |
virtual | ~EliminationSequenceStrategy () |
destructor More... | |
virtual EliminationSequenceStrategy * | 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 EliminationSequenceStrategy * | copyFactory () const =0 |
virtual copy constructor More... | |
EliminationSequenceStrategy () | |
default constructor More... | |
EliminationSequenceStrategy (UndiGraph *graph, const NodeProperty< Size > *domain_sizes) | |
constructor for an a priori non empty graph More... | |
EliminationSequenceStrategy (const EliminationSequenceStrategy &from) | |
copy constructor More... | |
EliminationSequenceStrategy (EliminationSequenceStrategy &&from) | |
move constructor More... | |
The base class for all elimination sequence algorithms used by triangulation algorithms.
Definition at line 49 of file eliminationSequenceStrategy.h.
|
virtual |
destructor
Definition at line 86 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
default constructor
Definition at line 57 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
constructor for an a priori non empty graph
Definition at line 62 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
copy constructor
Definition at line 71 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
move constructor
Definition at line 79 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
staticprivate |
an empty fill-ins set used by default
Definition at line 39 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
pure virtual |
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 in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, gum::OrderedEliminationSequenceStrategy, and gum::PartialOrderedEliminationSequenceStrategy.
Definition at line 98 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
pure virtual |
virtual copy constructor
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, gum::OrderedEliminationSequenceStrategy, gum::UnconstrainedEliminationSequenceStrategy, and gum::PartialOrderedEliminationSequenceStrategy.
|
noexcept |
returns the current domain sizes
Definition at line 40 of file eliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
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.
|
virtual |
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().
|
noexcept |
returns the current graph
Definition at line 36 of file eliminationSequenceStrategy_inl.h.
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
Implemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, gum::OrderedEliminationSequenceStrategy, gum::UnconstrainedEliminationSequenceStrategy, and gum::PartialOrderedEliminationSequenceStrategy.
|
pure virtual |
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.
|
pure virtual |
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 virtual |
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 variables/nodes |
Reimplemented in gum::DefaultPartialOrderedEliminationSequenceStrategy, gum::DefaultEliminationSequenceStrategy, gum::OrderedEliminationSequenceStrategy, and gum::PartialOrderedEliminationSequenceStrategy.
Definition at line 105 of file eliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
protected |
the domain sizes of the variables/nodes
Definition at line 158 of file eliminationSequenceStrategy.h.
|
protected |
the graph to be triangulated
Definition at line 155 of file eliminationSequenceStrategy.h.
|
protected |
the log of the domain sizes of the variables/nodes
Definition at line 161 of file eliminationSequenceStrategy.h.