aGrUM  0.14.2
eliminationSequenceStrategy.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  ***************************************************************************/
30 #ifndef GUM_ELIMINATION_SEQUENCE_STRATEGY_H
31 #define GUM_ELIMINATION_SEQUENCE_STRATEGY_H
32 
33 #include <agrum/agrum.h>
35 #include <agrum/graphs/undiGraph.h>
36 
37 
38 namespace gum {
39 
48  public:
49  // ############################################################################
51  // ############################################################################
53 
56 
61  virtual EliminationSequenceStrategy* newFactory() const = 0;
62 
64 
65  virtual EliminationSequenceStrategy* copyFactory() const = 0;
66 
68 
69 
70  // ############################################################################
72  // ############################################################################
74 
76 
90  virtual bool setGraph(UndiGraph* graph, const NodeProperty< Size >* dom_sizes);
91 
93 
95  virtual NodeId nextNodeToEliminate() = 0;
96 
105  virtual void askFillIns(bool do_it) = 0;
106 
115  virtual bool providesFillIns() const = 0;
116 
127  virtual bool providesGraphUpdate() const = 0;
128 
130 
132  virtual void eliminationUpdate(const NodeId node);
133 
136  virtual const EdgeSet& fillIns();
137 
140  virtual void clear();
141 
143  UndiGraph* graph() const noexcept;
144 
146  const NodeProperty< Size >* domainSizes() const noexcept;
147 
149 
150 
151  protected:
153  UndiGraph* _graph{nullptr};
154 
157 
160 
161 
162  // ############################################################################
164  // ############################################################################
166 
169 
172  const NodeProperty< Size >* domain_sizes);
173 
176 
179 
181 
182  private:
184  static const EdgeSet& __empty_fill_ins();
185  };
186 
187 
188 } /* namespace gum */
189 
190 
191 #ifndef GUM_NO_INLINE
193 #endif // GUM_NOINLINE
194 
195 
196 #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
Base classes for undirected graphs.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:676
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:106
const NodeProperty< Size > * _domain_sizes
the domain sizes of the variables/nodes
Base Class for all elimination sequence algorithms used by triangulations.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
virtual bool providesFillIns() const =0
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the ...
some utils for topology : NodeId, Edge, Arc and consorts ...
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 ...