58 double theThreshold) :
100 from._simplicial_set_ =
nullptr;
185 double min_weight = iter_heuristic.val();
186 NodeId removable_node = iter_heuristic.key();
187 for (++iter_heuristic; iter_heuristic !=
_log_weights_.cend(); ++iter_heuristic) {
188 if (iter_heuristic.val() < min_weight) {
189 removable_node = iter_heuristic.key();
190 min_weight = iter_heuristic.val();
194 return removable_node;
~DefaultEliminationSequenceStrategy() override
destructor
void askFillIns(bool do_it) final
if the elimination sequence is able to compute fill-ins, we indicate whether we want this feature to ...
NodeId nextNodeToEliminate() final
returns the new node to be eliminated within the triangulation algorithm
void _createSimplicialSet_()
create a new simplicial set suited for the current graph
double _simplicial_threshold_
the threshold used by simplicial_set to determine small cliques
NodeProperty< double > _log_weights_
for each node, the weight of the clique created by the node's elimination
const EdgeSet & fillIns() final
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
double _simplicial_ratio_
the ratio used by simplicial_set for its quasi-simplicial nodes
bool providesGraphUpdate() const final
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
void clear() final
clears the sequence (to prepare, for instance, a new elimination sequence)
void eliminationUpdate(const NodeId node) final
performs all the graph/fill-ins updates provided (if any)
DefaultEliminationSequenceStrategy(double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
default constructor (uses an empty graph)
SimplicialSet * _simplicial_set_
the simplicial set used for determining the best nodes to eliminate
bool providesFillIns() const final
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the ...
bool _provide_fill_ins_
indicates whether we compute new fill-ins
bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
DefaultEliminationSequenceStrategy * newFactory() const final
creates a new elimination sequence of the same type as the current object, but this sequence contains...
DefaultEliminationSequenceStrategy * copyFactory() const final
virtual copy constructor
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
NodeProperty< double > log_domain_sizes_
the log of the domain sizes of the variables/nodes
UndiGraph * graph_
the graph to be triangulated
virtual void clear()
clears the sequence (to prepare, for instance, a new elimination sequence)
virtual const EdgeSet & fillIns()
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
Exception : the element we looked for cannot be found.
Class enabling fast retrieval of simplicial, quasi and almost simplicial nodes.
NodeId bestSimplicialNode()
returns the simplicial node with the lowest clique weight
bool hasSimplicialNode()
indicates whether there exists a simplicial node
bool hasAlmostSimplicialNode()
indicates whether there exists an almost simplicial node
SimplicialSet(UndiGraph *graph, const NodeProperty< double > *log_domain_sizes, NodeProperty< double > *log_weights, double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
constructor. initializes the simplicial set w.r.t. a given graph
NodeId bestAlmostSimplicialNode()
gets the almost simplicial node with the lowest clique weight
NodeId bestQuasiSimplicialNode()
gets a quasi simplicial node with the lowest clique weight
void makeClique(const NodeId id)
adds the necessary edges so that node 'id' and its neighbors form a clique
void setFillIns(bool on_off)
sets/unset the fill-ins storage in the standard triangulation procedure
void replaceLogWeights(NodeProperty< double > *old_weigths, NodeProperty< double > *new_weights)
reassigns a new set of cliques' log weights (with the same content)
void eraseClique(const NodeId id)
removes a node and its adjacent edges from the underlying graph
bool hasQuasiSimplicialNode()
indicates whether there exists a quasi simplicial node
const EdgeSet & fillIns() const
returns the set of all the fill-ins added to the graph so far
UnconstrainedEliminationSequenceStrategy()
default constructor
Base class for undirected graphs.
An efficient unconstrained elimination sequence algorithm.
#define GUM_ERROR(type, msg)
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
gum is the global namespace for all aGrUM entities