aGrUM  0.14.2
orderedEliminationSequenceStrategy.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  ***************************************************************************/
27 #ifndef GUM_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
28 #define GUM_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
29 
31 #include <vector>
32 
33 namespace gum {
34 
43  public:
44  // ############################################################################
46  // ############################################################################
48 
51 
53 
65  const NodeProperty< Size >* dom_sizes,
66  const std::vector< NodeId >* order);
67 
71 
74 
77 
82  virtual OrderedEliminationSequenceStrategy* newFactory() const final;
83 
85  virtual OrderedEliminationSequenceStrategy* copyFactory() const final;
86 
88 
89 
90  // ############################################################################
92  // ############################################################################
94 
96 
107  virtual bool setGraph(UndiGraph* graph,
108  const NodeProperty< Size >* dom_sizes) final;
109 
111 
121  virtual bool setOrder(const std::vector< NodeId >* order) final;
122 
124  virtual void clear() final;
125 
127 
129  virtual NodeId nextNodeToEliminate() final;
130 
137  virtual void askFillIns(bool do_it) final;
138 
146  virtual bool providesFillIns() const final;
147 
150  virtual bool providesGraphUpdate() const final;
151 
153 
155  virtual void eliminationUpdate(const NodeId node) final;
156 
159  virtual const EdgeSet& fillIns() final;
160 
162  const std::vector< NodeId >* order() const noexcept;
163 
165 
168  bool isOrderNeeded() const noexcept;
169 
171 
172 
173  private:
175  const std::vector< NodeId >* __order{nullptr};
176 
178  std::size_t __order_index{std::size_t(0)};
179 
182  bool __order_needed{true};
183 
184 
186  bool __isOrderNeeded(const std::vector< NodeId >* order) const;
187  };
188 
189 
190 } /* namespace gum */
191 
192 
193 #ifndef GUM_NO_INLINE
195 #endif // GUM_NOINLINE
196 
197 
198 #endif /* GUM_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H */
bool isOrderNeeded() const noexcept
indicates whether a new complete ordering is needed
bool __isOrderNeeded(const std::vector< NodeId > *order) const
indicates whether an order is compatible with the current graph
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
OrderedEliminationSequenceStrategy()
default constructor (uses an empty graph)
bool __order_needed
indicate whether a new complete ordering is necessary for the elimination
virtual void clear() final
clears the order (to prepare, for instance, a new elimination sequence)
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
std::size_t __order_index
the index in the order indicating the new node to eliminate
virtual bool setOrder(const std::vector< NodeId > *order) final
sets the sequence of elimination
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
const std::vector< NodeId > * order() const noexcept
returns the current complete ordering
virtual NodeId nextNodeToEliminate() final
returns the new node to be eliminated within the triangulation algorithm
virtual void eliminationUpdate(const NodeId node) final
performs all the graph/fill-ins updates provided (if any)
Base Class for all elimination sequence algorithms used by triangulations.
The base class for all elimination sequence algorithms used by triangulation algorithms.
virtual OrderedEliminationSequenceStrategy * copyFactory() const final
virtual copy constructor
Base class for undirected graphs.
Definition: undiGraph.h:106
virtual bool providesGraphUpdate() const final
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
const std::vector< NodeId > * __order
the vector indicating in which order we should eliminate the nodes
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 ...
Size NodeId
Type for node ids.
Definition: graphElements.h:97
virtual OrderedEliminationSequenceStrategy * newFactory() const final
creates a new elimination sequence of the same type as the current object, but this sequence contains...
virtual const EdgeSet & fillIns() final
in case fill-ins are provided, this function returns the fill-ins due to all the nodes eliminated so ...
virtual bool providesFillIns() const final
indicates whether the fill-ins generated by the eliminated nodes, if needed, will be computed by the ...