40 double theThreshold) :
41 __simplicial_ratio(theRatio),
42 __simplicial_threshold(theThreshold) {
94 from.__simplicial_set =
nullptr;
155 double min_score = 0;
160 double score = possibleNodes.
priority(node);
162 if (!found || (score < min_score)) {
182 "the partial order does not cover all the nodes " 210 if (score < min_score) {
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 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 ...
virtual void clear() final
clears the sequence (to prepare, for instance, a new elimination sequence)
void __createSimplicialSet()
create a new simplicial set suited for the current graph
bool empty() const noexcept
Indicates whether the set is the empty set.
UndiGraph * _graph
the graph to be triangulated
virtual void eliminationUpdate(const NodeId node) final
performs all the graph/fill-ins updates provided (if any)
virtual DefaultPartialOrderedEliminationSequenceStrategy * newFactory() const final
creates a new elimination sequence of the same type as the current object, but this sequence contains...
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 ...
void replaceLogWeights(NodeProperty< double > *old_weigths, NodeProperty< double > *new_weights)
reassigns a new set of cliques' log weights (with the same content)
const Priority & priority(const Val &elt) const
Returns the priority of an instance of the value passed in argument.
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 ...
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
virtual bool setPartialOrder(const List< NodeSet > *subsets)
sets a new partial ordering constraint on the elimination sequence
NodeProperty< double > __log_weights
for each node, the weight of the clique created by the node's elimination
double __simplicial_ratio
the ratio used by __simplicial_set for its quasi-simplicial nodes
const_iterator cbegin() const
The usual unsafe begin iterator to parse the set.
void erase(const Key &k)
Erases an element from the set.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual NodeId nextNodeToEliminate() final
returns the new node to be eliminated within the triangulation algorithm
Generic doubly linked lists.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double __simplicial_threshold
the threshold used by __simplicial_set to determine small cliques
An Elimination sequence algorithm that imposes a given partial ordering on the nodes elimination sequ...
NodeId __nodeToEliminate(const PriorityQueue< NodeId, double > &possibleNodes)
returns the best possible node to be eliminated
The class for generic Hash Tables.
UndiGraph * graph() const noexcept
returns the current graph
bool __provide_fill_ins
indicates whether we compute new fill-ins
SimplicialSet * __simplicial_set
the simplicial set used for determining the best nodes to eliminate
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
const PriorityQueue< NodeId, double > & allSimplicialNodes()
returns all the simplicial nodes
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
Class enabling fast retrieval of simplicial, quasi and almost simplicial nodes.
const const_iterator & cend() const noexcept
The usual unsafe end iterator to parse the set.
virtual bool providesGraphUpdate() const final
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
NodeSet _nodeset
the nodes which can be currently eliminated
virtual ~DefaultPartialOrderedEliminationSequenceStrategy()
destructor
const List< NodeSet > * _subsets
the subsets constituting the partial ordering
bool existsNode(const NodeId id) const
returns true iff the NodeGraphPart contains the given nodeId
virtual DefaultPartialOrderedEliminationSequenceStrategy * copyFactory() const final
virtual copy constructor
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
Base class for undirected graphs.
const PriorityQueue< NodeId, double > & allAlmostSimplicialNodes()
returns all the almost simplicial nodes
List< NodeSet >::const_iterator _subset_iter
the iterator indicating which is the current subset on which we work
bool _partial_order_needed
indicate whether a new partial ordering is necessary for the elimination
DefaultPartialOrderedEliminationSequenceStrategy(double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
default constructor (uses an empty graph)
const PriorityQueue< NodeId, double > & allQuasiSimplicialNodes()
returns all the quasi simplicial nodes
void setFillIns(bool on_off)
sets/unset the fill-ins storage in the standard triangulation procedure
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.
void insert(const Key &k)
Inserts a new element into the set.
#define GUM_ERROR(type, msg)
const EdgeSet & fillIns() const
returns the set of all the fill-ins added to the graph so far