aGrUM  0.14.2
defaultEliminationSequenceStrategy.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
40 #ifndef GUM_DEFAULT_ELIMINATION_SEQUENCE_STRATEGY_H
41 #define GUM_DEFAULT_ELIMINATION_SEQUENCE_STRATEGY_H
42 
43 
44 #include <agrum/agrum.h>
48 
49 
50 namespace gum {
51 
52 
75  public:
76  // ############################################################################
78  // ############################################################################
80 
82 
87  double theThreshold = GUM_WEIGHT_THRESHOLD);
88 
90 
104  const NodeProperty< Size >* dom_sizes,
105  double ratio = GUM_QUASI_RATIO,
106  double threshold = GUM_WEIGHT_THRESHOLD);
107 
109 
120 
123 
126 
131  virtual DefaultEliminationSequenceStrategy* newFactory() const final;
132 
134 
143  virtual DefaultEliminationSequenceStrategy* copyFactory() const final;
144 
146 
147 
148  // ############################################################################
150  // ############################################################################
152 
154 
165  virtual bool setGraph(UndiGraph* graph,
166  const NodeProperty< Size >* dom_sizes) final;
167 
170  virtual void clear() final;
171 
173 
175  virtual NodeId nextNodeToEliminate() final;
176 
183  virtual void askFillIns(bool do_it) final;
184 
192  virtual bool providesFillIns() const final;
193 
204  virtual bool providesGraphUpdate() const final;
205 
207 
209  virtual void eliminationUpdate(const NodeId node) final;
210 
213  virtual const EdgeSet& fillIns() final;
214 
216 
217  private:
221 
224 
227 
230 
232  bool __provide_fill_ins{false};
233 
234 
236  void __createSimplicialSet();
237  };
238 
239 
240 } /* namespace gum */
241 
242 
243 #endif /* GUM_DEFAULT_ELIMINATION_SEQUENCE_STRATEGY_H */
void __createSimplicialSet()
create a new simplicial set suited for the current graph
NodeProperty< double > __log_weights
for each node, the weight of the clique created by the node&#39;s elimination
#define GUM_WEIGHT_THRESHOLD
Definition: simplicialSet.h:38
Class for fast retrieval of simplicial and quasi/almost simplicial nodes.
virtual 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)
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 ...
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
SimplicialSet * __simplicial_set
the simplicial set used for determining the best nodes to eliminate
The class for generic Hash Tables.
Definition: hashTable.h:676
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...
Base Class for all elimination sequence algorithms that require only the graph to be triangulated and...
Class enabling fast retrieval of simplicial, quasi and almost simplicial nodes.
Definition: simplicialSet.h:57
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
virtual void clear() final
clears the sequence (to prepare, for instance, a new elimination sequence)
Base class for undirected graphs.
Definition: undiGraph.h:106
#define GUM_QUASI_RATIO
Definition: simplicialSet.h:37
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
The base class for all elimination sequence algorithms that require only the graph to be triangulated...
Size NodeId
Type for node ids.
Definition: graphElements.h:97
virtual DefaultEliminationSequenceStrategy * copyFactory() const final
virtual copy constructor
some utils for topology : NodeId, Edge, Arc and consorts ...
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...