![]() |
aGrUM
0.16.0
|
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 45 of file orderedEliminationSequenceStrategy.h.
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | ) |
default constructor (uses an empty graph)
Definition at line 42 of file orderedEliminationSequenceStrategy.cpp.
Referenced by copyFactory(), and newFactory().
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 48 of file orderedEliminationSequenceStrategy.cpp.
References GUM_ERROR, and setOrder().
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | const OrderedEliminationSequenceStrategy & | from | ) |
copy constructor
Definition at line 68 of file orderedEliminationSequenceStrategy.cpp.
gum::OrderedEliminationSequenceStrategy::OrderedEliminationSequenceStrategy | ( | OrderedEliminationSequenceStrategy && | from | ) |
move constructor
Definition at line 78 of file orderedEliminationSequenceStrategy.cpp.
|
virtual |
destructor
Definition at line 88 of file orderedEliminationSequenceStrategy.cpp.
|
private |
indicates whether an order is compatible with the current graph
Definition at line 118 of file orderedEliminationSequenceStrategy.cpp.
References gum::EliminationSequenceStrategy::_graph, gum::NodeGraphPart::existsNode(), gum::Set< Key, Alloc >::insert(), and gum::NodeGraphPart::size().
Referenced by setOrder().
|
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 174 of file orderedEliminationSequenceStrategy.cpp.
|
finalvirtual |
clears the order (to prepare, for instance, a new elimination sequence)
Reimplemented from gum::EliminationSequenceStrategy.
Definition at line 156 of file orderedEliminationSequenceStrategy.cpp.
References __order_index, __order_needed, and gum::EliminationSequenceStrategy::clear().
|
finalvirtual |
virtual copy constructor
Implements gum::EliminationSequenceStrategy.
Definition at line 102 of file orderedEliminationSequenceStrategy.cpp.
References OrderedEliminationSequenceStrategy().
|
noexceptinherited |
returns the current domain sizes
Definition at line 44 of file eliminationSequenceStrategy_inl.h.
References gum::EliminationSequenceStrategy::_domain_sizes.
|
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 192 of file orderedEliminationSequenceStrategy.cpp.
References __order, __order_index, __order_needed, gum::EliminationSequenceStrategy::_graph, gum::NodeGraphPart::existsNode(), and GUM_ERROR.
|
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 215 of file orderedEliminationSequenceStrategy.cpp.
References gum::EliminationSequenceStrategy::fillIns().
|
noexceptinherited |
returns the current graph
Definition at line 37 of file eliminationSequenceStrategy_inl.h.
References gum::EliminationSequenceStrategy::_graph.
Referenced by gum::EliminationSequenceStrategy::setGraph().
|
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 41 of file orderedEliminationSequenceStrategy_inl.h.
References __order_needed.
|
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 96 of file orderedEliminationSequenceStrategy.cpp.
References OrderedEliminationSequenceStrategy().
|
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 163 of file orderedEliminationSequenceStrategy.cpp.
References __order, __order_index, __order_needed, and GUM_ERROR.
|
noexcept |
returns the current complete ordering
Definition at line 35 of file orderedEliminationSequenceStrategy_inl.h.
References __order.
Referenced by setOrder().
|
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 181 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 187 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 107 of file orderedEliminationSequenceStrategy.cpp.
References __order, gum::EliminationSequenceStrategy::setGraph(), and setOrder().
Referenced by gum::OrderedTriangulation::_initTriangulation().
|
finalvirtual |
sets the sequence of elimination
sets a new complete order
order | the order in which the nodes should be eliminated |
Definition at line 133 of file orderedEliminationSequenceStrategy.cpp.
References __isOrderNeeded(), __order, __order_index, __order_needed, gum::EliminationSequenceStrategy::_graph, gum::NodeGraphPart::existsNode(), and order().
Referenced by gum::OrderedTriangulation::_initTriangulation(), OrderedEliminationSequenceStrategy(), and setGraph().
|
private |
the vector indicating in which order we should eliminate the nodes
Definition at line 178 of file orderedEliminationSequenceStrategy.h.
Referenced by eliminationUpdate(), nextNodeToEliminate(), order(), setGraph(), and setOrder().
|
private |
the index in the order indicating the new node to eliminate
Definition at line 181 of file orderedEliminationSequenceStrategy.h.
Referenced by clear(), eliminationUpdate(), nextNodeToEliminate(), and setOrder().
|
private |
indicate whether a new complete ordering is necessary for the elimination
Definition at line 185 of file orderedEliminationSequenceStrategy.h.
Referenced by clear(), eliminationUpdate(), isOrderNeeded(), nextNodeToEliminate(), and setOrder().
|
protectedinherited |
the domain sizes of the variables/nodes
Definition at line 159 of file eliminationSequenceStrategy.h.
Referenced by gum::EliminationSequenceStrategy::clear(), gum::EliminationSequenceStrategy::domainSizes(), and gum::EliminationSequenceStrategy::setGraph().
|
protectedinherited |
the graph to be triangulated
Definition at line 156 of file eliminationSequenceStrategy.h.
Referenced by gum::DefaultEliminationSequenceStrategy::__createSimplicialSet(), gum::DefaultPartialOrderedEliminationSequenceStrategy::__createSimplicialSet(), __isOrderNeeded(), gum::PartialOrderedEliminationSequenceStrategy::_isPartialOrderNeeded(), gum::EliminationSequenceStrategy::clear(), eliminationUpdate(), gum::DefaultPartialOrderedEliminationSequenceStrategy::eliminationUpdate(), gum::EliminationSequenceStrategy::graph(), gum::DefaultEliminationSequenceStrategy::nextNodeToEliminate(), gum::DefaultPartialOrderedEliminationSequenceStrategy::nextNodeToEliminate(), gum::EliminationSequenceStrategy::setGraph(), setOrder(), and gum::PartialOrderedEliminationSequenceStrategy::setPartialOrder().
|
protectedinherited |
the log of the domain sizes of the variables/nodes
Definition at line 162 of file eliminationSequenceStrategy.h.
Referenced by gum::DefaultEliminationSequenceStrategy::__createSimplicialSet(), gum::DefaultPartialOrderedEliminationSequenceStrategy::__createSimplicialSet(), gum::EliminationSequenceStrategy::clear(), and gum::EliminationSequenceStrategy::setGraph().