37 double theRatio,
double theThreshold) :
38 __simplicial_ratio(theRatio),
39 __simplicial_threshold(theThreshold) {
86 from.__simplicial_set =
nullptr;
177 double min_weight = iter_heuristic.val();
178 NodeId removable_node = iter_heuristic.key();
179 for (++iter_heuristic; iter_heuristic !=
__log_weights.cend();
181 if (iter_heuristic.val() < min_weight) {
182 removable_node = iter_heuristic.key();
183 min_weight = iter_heuristic.val();
187 return removable_node;
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void clear()
clears the sequence (to prepare, for instance, a new elimination sequence)
void __createSimplicialSet()
create a new simplicial set suited for the current graph
void makeClique(const NodeId id)
adds the necessary edges so that node 'id' and its neighbors form a clique
virtual const EdgeSet & fillIns()
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
NodeId bestQuasiSimplicialNode()
gets a quasi simplicial node with the lowest clique weight
NodeProperty< double > __log_weights
for each node, the weight of the clique created by the node's elimination
UndiGraph * _graph
the graph to be triangulated
bool hasQuasiSimplicialNode()
indicates whether there exists a quasi simplicial node
void replaceLogWeights(NodeProperty< double > *old_weigths, NodeProperty< double > *new_weights)
reassigns a new set of cliques' log weights (with the same content)
virtual void eliminationUpdate(const NodeId node) final
performs all the graph/fill-ins updates provided (if any)
bool hasAlmostSimplicialNode()
indicates whether there exists an almost simplicial node
NodeProperty< double > _log_domain_sizes
the log of the domain sizes of the variables/nodes
void eraseClique(const NodeId id)
removes a node and its adjacent edges from the underlying graph
DefaultEliminationSequenceStrategy(double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
default constructor (uses an empty graph)
virtual bool providesFillIns() const final
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the ...
virtual const EdgeSet & fillIns() final
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
SimplicialSet * __simplicial_set
the simplicial set used for determining the best nodes to eliminate
The class for generic Hash Tables.
double __simplicial_ratio
the ratio used by __simplicial_set for its quasi-simplicial nodes
UndiGraph * graph() const noexcept
returns the current graph
An efficient unconstrained elimination sequence algorithm.
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 ...
virtual bool providesGraphUpdate() const final
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
Class enabling fast retrieval of simplicial, quasi and almost simplicial nodes.
bool hasSimplicialNode()
indicates whether there exists a simplicial node
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
NodeId bestAlmostSimplicialNode()
gets the almost simplicial node with the lowest clique weight
virtual void clear() final
clears the sequence (to prepare, for instance, a new elimination sequence)
Base class for undirected graphs.
NodeId bestSimplicialNode()
returns the simplicial node with the lowest clique weight
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool __provide_fill_ins
indicates whether we compute new fill-ins
virtual NodeId nextNodeToEliminate() final
returns the new node to be eliminated within the triangulation algorithm
virtual ~DefaultEliminationSequenceStrategy()
destructor
void setFillIns(bool on_off)
sets/unset the fill-ins storage in the standard triangulation procedure
The base class for all elimination sequence algorithms that require only the graph to be triangulated...
Size NodeId
Type for node ids.
#define GUM_ERROR(type, msg)
virtual DefaultEliminationSequenceStrategy * copyFactory() const final
virtual copy constructor
const EdgeSet & fillIns() const
returns the set of all the fill-ins added to the graph so far
double __simplicial_threshold
the threshold used by __simplicial_set to determine small cliques
virtual DefaultEliminationSequenceStrategy * newFactory() const final
creates a new elimination sequence of the same type as the current object, but this sequence contains...