aGrUM  0.16.0
orderedEliminationSequenceStrategy.h
Go to the documentation of this file.
1 
30 #ifndef GUM_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
31 #define GUM_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
32 
34 #include <vector>
35 
36 namespace gum {
37 
46  public:
47  // ############################################################################
49  // ############################################################################
51 
54 
56 
68  const NodeProperty< Size >* dom_sizes,
69  const std::vector< NodeId >* order);
70 
74 
77 
80 
85  virtual OrderedEliminationSequenceStrategy* newFactory() const final;
86 
88  virtual OrderedEliminationSequenceStrategy* copyFactory() const final;
89 
91 
92 
93  // ############################################################################
95  // ############################################################################
97 
99 
110  virtual bool setGraph(UndiGraph* graph,
111  const NodeProperty< Size >* dom_sizes) final;
112 
114 
124  virtual bool setOrder(const std::vector< NodeId >* order) final;
125 
127  virtual void clear() final;
128 
130 
132  virtual NodeId nextNodeToEliminate() final;
133 
140  virtual void askFillIns(bool do_it) final;
141 
149  virtual bool providesFillIns() const final;
150 
153  virtual bool providesGraphUpdate() const final;
154 
156 
158  virtual void eliminationUpdate(const NodeId node) final;
159 
162  virtual const EdgeSet& fillIns() final;
163 
165  const std::vector< NodeId >* order() const noexcept;
166 
168 
171  bool isOrderNeeded() const noexcept;
172 
174 
175 
176  private:
178  const std::vector< NodeId >* __order{nullptr};
179 
181  std::size_t __order_index{std::size_t(0)};
182 
185  bool __order_needed{true};
186 
187 
189  bool __isOrderNeeded(const std::vector< NodeId >* order) const;
190  };
191 
192 
193 } /* namespace gum */
194 
195 
196 #ifndef GUM_NO_INLINE
198 #endif // GUM_NOINLINE
199 
200 
201 #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
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
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)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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:109
virtual bool providesGraphUpdate() const final
indicates whether the elimination sequence updates by itself the graph after a node has been eliminat...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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:98
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 ...