aGrUM  0.14.2
partialOrderedEliminationSequenceStrategy.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  ***************************************************************************/
31 #ifndef GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
32 #define GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
33 
34 #include <agrum/core/list.h>
36 
37 namespace gum {
38 
54  public:
55  // ############################################################################
57  // ############################################################################
59 
62 
68 
71 
73 
74 
75  // ############################################################################
77  // ############################################################################
79 
81 
94  virtual bool setGraph(UndiGraph* graph, const NodeProperty< Size >* dom_sizes);
95 
97 
106  virtual bool setPartialOrder(const List< NodeSet >* subsets);
107 
110  virtual void clear();
111 
113  const List< NodeSet >* partialOrder() const noexcept;
114 
116 
119  bool isPartialOrderNeeded() const noexcept;
120 
122 
123 
124  protected:
126  const List< NodeSet >* _subsets{nullptr};
127 
130 
133 
136 
137 
139 
143  bool _isPartialOrderNeeded(const List< NodeSet >* subsets) const;
144 
145 
146  // ############################################################################
148  // ############################################################################
150 
153 
155 
167  UndiGraph* graph,
168  const NodeProperty< Size >* dom_sizes,
169  const List< NodeSet >* subsets);
170 
174 
178 
180  };
181 
182 } /* namespace gum */
183 
184 
185 #ifndef GUM_NO_INLINE
187 #endif // GUM_NOINLINE
188 
189 
190 #endif /* GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H */
virtual void clear()
clears the sequence (to prepare, for instance, a new elimination sequence)
virtual PartialOrderedEliminationSequenceStrategy * copyFactory() const =0
virtual copy constructor
bool _isPartialOrderNeeded(const List< NodeSet > *subsets) const
indicate whether a partial ordering is compatible with the current graph
virtual bool setPartialOrder(const List< NodeSet > *subsets)
sets a new partial ordering constraint on the elimination sequence
Generic doubly linked lists.
Definition: list.h:369
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
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
PartialOrderedEliminationSequenceStrategy()
default constructor (uses an empty graph)
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
Generic class for manipulating lists.
NodeSet _nodeset
the nodes which can be currently eliminated
virtual PartialOrderedEliminationSequenceStrategy * newFactory() const =0
creates a new elimination sequence of the same type as the current object, but this sequence contains...
const List< NodeSet > * _subsets
the subsets constituting the partial ordering
Unsafe but fast const iterators for Lists.
Definition: list.h:1505
Base Class for all elimination sequence algorithms used by triangulations.
The base class for all elimination sequence algorithms used by triangulation algorithms.
bool isPartialOrderNeeded() const noexcept
indicates if a new partial ordering is needed
Base class for undirected graphs.
Definition: undiGraph.h:106
const List< NodeSet > * partialOrder() const noexcept
returns the current partial ordering
List< NodeSet >::const_iterator _subset_iter
the iterator indicating which is the current subset on which we work
bool _partial_order_needed
indicate whether a new partial ordering is necessary for the elimination