aGrUM  0.16.0
eliminationSequenceStrategy.h
Go to the documentation of this file.
1 
33 #ifndef GUM_ELIMINATION_SEQUENCE_STRATEGY_H
34 #define GUM_ELIMINATION_SEQUENCE_STRATEGY_H
35 
36 #include <agrum/agrum.h>
38 #include <agrum/graphs/undiGraph.h>
39 
40 
41 namespace gum {
42 
51  public:
52  // ############################################################################
54  // ############################################################################
56 
59 
64  virtual EliminationSequenceStrategy* newFactory() const = 0;
65 
67 
68  virtual EliminationSequenceStrategy* copyFactory() const = 0;
69 
71 
72 
73  // ############################################################################
75  // ############################################################################
77 
79 
93  virtual bool setGraph(UndiGraph* graph, const NodeProperty< Size >* dom_sizes);
94 
96 
98  virtual NodeId nextNodeToEliminate() = 0;
99 
108  virtual void askFillIns(bool do_it) = 0;
109 
118  virtual bool providesFillIns() const = 0;
119 
130  virtual bool providesGraphUpdate() const = 0;
131 
133 
135  virtual void eliminationUpdate(const NodeId node);
136 
139  virtual const EdgeSet& fillIns();
140 
143  virtual void clear();
144 
146  UndiGraph* graph() const noexcept;
147 
149  const NodeProperty< Size >* domainSizes() const noexcept;
150 
152 
153 
154  protected:
156  UndiGraph* _graph{nullptr};
157 
160 
163 
164 
165  // ############################################################################
167  // ############################################################################
169 
172 
175  const NodeProperty< Size >* domain_sizes);
176 
179 
182 
184 
185  private:
187  static const EdgeSet& __empty_fill_ins();
188  };
189 
190 
191 } /* namespace gum */
192 
193 
194 #ifndef GUM_NO_INLINE
196 #endif // GUM_NOINLINE
197 
198 
199 #endif /* GUM_ELIMINATION_SEQUENCE_STRATEGY_H */
virtual void clear()
clears the sequence (to prepare, for instance, a new elimination sequence)
virtual void eliminationUpdate(const NodeId node)
performs all the graph/fill-ins updates provided (if any)
virtual const EdgeSet & fillIns()
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
virtual EliminationSequenceStrategy * copyFactory() const =0
virtual copy constructor
UndiGraph * _graph
the graph to be triangulated
NodeProperty< double > _log_domain_sizes
the log of the domain sizes of the variables/nodes
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:679
UndiGraph * graph() const noexcept
returns the current graph
static const EdgeSet & __empty_fill_ins()
an empty fill-ins set used by default
const NodeProperty< Size > * domainSizes() const noexcept
returns the current domain sizes
virtual EliminationSequenceStrategy * newFactory() const =0
creates a new elimination sequence of the same type as the current object, but this sequence contains...
virtual bool providesGraphUpdate() const =0
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
virtual NodeId nextNodeToEliminate()=0
returns the new node to be eliminated within the triangulation algorithm
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
The base class for all elimination sequence algorithms used by triangulation algorithms.
Base class for undirected graphs.
Definition: undiGraph.h:109
const NodeProperty< Size > * _domain_sizes
the domain sizes of the variables/nodes
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
virtual bool providesFillIns() const =0
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the ...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void askFillIns(bool do_it)=0
if the elimination sequence is able to compute fill-ins, we indicate whether we want this feature to ...