![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination sequence. More...
#include <orderedEliminationSequenceStrategy.h>
Public Member Functions | |
Constructors / Destructors | |
OrderedEliminationSequenceStrategy () | |
default constructor (uses an empty graph) More... | |
OrderedEliminationSequenceStrategy (UndiGraph *graph, const NodeProperty< Size > *dom_sizes, const std::vector< NodeId > *order) | |
constructor for an a priori non empty graph More... | |
OrderedEliminationSequenceStrategy (const OrderedEliminationSequenceStrategy &from) | |
copy constructor More... | |
OrderedEliminationSequenceStrategy (OrderedEliminationSequenceStrategy &&from) | |
move constructor More... | |
virtual | ~OrderedEliminationSequenceStrategy () |
destructor More... | |
virtual OrderedEliminationSequenceStrategy * | newFactory () const final |
creates a new elimination sequence of the same type as the current object, but this sequence contains only an empty graph More... | |
virtual OrderedEliminationSequenceStrategy * | copyFactory () const final |
virtual copy constructor More... | |
Accessors / Modifiers | |
virtual bool | setGraph (UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final |
sets a new graph to be triangulated More... | |
virtual bool | setOrder (const std::vector< NodeId > *order) final |
sets the sequence of elimination More... | |
virtual void | clear () final |
clears the order (to prepare, for instance, a new elimination sequence) More... | |
virtual NodeId | nextNodeToEliminate () final |
returns the new node to be eliminated within the triangulation algorithm More... | |
virtual void | askFillIns (bool do_it) final |
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 final |
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 final |
indicates whether the elimination sequence updates by itself the graph after a node has been eliminated More... | |
virtual void | eliminationUpdate (const NodeId node) final |
performs all the graph/fill-ins updates provided (if any) More... | |
virtual const EdgeSet & | fillIns () final |
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so far More... | |
const std::vector< NodeId > * | order () const noexcept |
returns the current complete ordering More... | |
bool | isOrderNeeded () const noexcept |
indicates whether a new complete ordering is needed More... | |
Accessors / Modifiers | |
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... | |
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination sequence.
Definition at line 44 of file orderedEliminationSequenceStrategy.h.
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | ) |
default constructor (uses an empty graph)
Definition at line 41 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | UndiGraph * | graph, |
const NodeProperty< Size > * | dom_sizes, | ||
const std::vector< NodeId > * | order | ||
) |
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 |
order | the order in which the nodes should be eliminated |
Definition at line 46 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | const OrderedEliminationSequenceStrategy & | from | ) |
copy constructor
Definition at line 64 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | OrderedEliminationSequenceStrategy && | from | ) |
move constructor
Definition at line 73 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
virtual |
destructor
Definition at line 82 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
private |
indicates whether an order is compatible with the current graph
Definition at line 110 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
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. |
Implements gum::EliminationSequenceStrategy.
Definition at line 164 of file orderedEliminationSequenceStrategy.cpp.
|
finalvirtual |
clears the order (to prepare, for instance, a new elimination sequence)
Reimplemented from gum::EliminationSequenceStrategy.
Definition at line 146 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
virtual copy constructor
Implements gum::EliminationSequenceStrategy.
Definition at line 93 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
noexceptinherited |
returns the current domain sizes
Definition at line 40 of file eliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
performs all the graph/fill-ins updates provided (if any)
node | the node the elimination of which requires the graph update |
Reimplemented from gum::EliminationSequenceStrategy.
Definition at line 178 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so far
Reimplemented from gum::EliminationSequenceStrategy.
Definition at line 198 of file orderedEliminationSequenceStrategy.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 whether a new complete ordering is needed
if the current complete ordering does not contain all the nodes of the graph or if the graph itself is not defined (nullptr) a new complete ordering will be needed for the next triangulation
Definition at line 39 of file orderedEliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
creates a new elimination sequence of the same type as the current object, but this sequence contains only an empty graph
Implements gum::EliminationSequenceStrategy.
Definition at line 88 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
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 |
Implements gum::EliminationSequenceStrategy.
Definition at line 153 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
returns the current complete ordering
Definition at line 33 of file orderedEliminationSequenceStrategy_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
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)
Implements gum::EliminationSequenceStrategy.
Definition at line 171 of file orderedEliminationSequenceStrategy.cpp.
|
finalvirtual |
indicates whether the elimination sequence updates by itself the graph after a node has been eliminated
Implements gum::EliminationSequenceStrategy.
Definition at line 175 of file orderedEliminationSequenceStrategy.cpp.
|
finalvirtual |
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.
Definition at line 98 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtual |
sets the sequence of elimination
sets a new complete order
order | the order in which the nodes should be eliminated |
Definition at line 124 of file orderedEliminationSequenceStrategy.cpp.
References gum::Set< Key, Alloc >::emplace().
|
private |
the vector indicating in which order we should eliminate the nodes
Definition at line 175 of file orderedEliminationSequenceStrategy.h.
|
private |
the index in the order indicating the new node to eliminate
Definition at line 178 of file orderedEliminationSequenceStrategy.h.
|
private |
indicate whether a new complete ordering is necessary for the elimination
Definition at line 182 of file orderedEliminationSequenceStrategy.h.
|
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.