aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
partialOrderedEliminationSequenceStrategy.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2025 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2025 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41
52
53#ifndef GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
54#define GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H
55
57
58namespace gum {
59
74 public:
75 // ############################################################################
77 // ############################################################################
79
82
88
91
93
94
95 // ############################################################################
97 // ############################################################################
99
101
114 virtual bool setGraph(UndiGraph* graph, const NodeProperty< Size >* dom_sizes);
115
117
126 virtual bool setPartialOrder(const List< NodeSet >* subsets);
127
130 virtual void clear();
131
133 const List< NodeSet >* partialOrder() const noexcept;
134
136
139 bool isPartialOrderNeeded() const noexcept;
140
142
143
144 protected:
146 const List< NodeSet >* subsets_{nullptr};
147
150
153
156
157
159
163 bool isPartialOrderNeeded_(const List< NodeSet >* subsets) const;
164
165
166 // ############################################################################
168 // ############################################################################
170
173
175
187 const NodeProperty< Size >* dom_sizes,
188 const List< NodeSet >* subsets);
189
192
195
197 };
198
199} /* namespace gum */
200
201
202#ifndef GUM_NO_INLINE
204#endif // GU%_NO_INLINE
205
206
207#endif /* GUM_PARTIAL_ORDERED_ELIMINATION_SEQUENCE_STRATEGY_H */
UndiGraph * graph() const noexcept
returns the current graph
Generic doubly linked lists.
Definition list.h:379
ListConstIterator< Val > const_iterator
Types for STL compliance.
Definition list.h:391
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
bool isPartialOrderNeeded_(const List< NodeSet > *subsets) const
indicate whether a partial ordering is compatible with the current graph
bool partial_order_needed_
indicate whether a new partial ordering is necessary for the elimination
virtual PartialOrderedEliminationSequenceStrategy * copyFactory() const =0
virtual copy constructor
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
const List< NodeSet > * subsets_
the subsets constituting the partial ordering
const List< NodeSet > * partialOrder() const noexcept
returns the current partial ordering
virtual PartialOrderedEliminationSequenceStrategy * newFactory() const =0
creates a new elimination sequence of the same type as the current object, but this sequence contains...
List< NodeSet >::const_iterator subset_iter_
the iterator indicating which is the current subset on which we work
bool isPartialOrderNeeded() const noexcept
indicates if a new partial ordering is needed
PartialOrderedEliminationSequenceStrategy()
default constructor (uses an empty graph)
virtual bool setPartialOrder(const List< NodeSet > *subsets)
sets a new partial ordering constraint on the elimination sequence
NodeSet nodeset_
the nodes which can be currently eliminated
virtual void clear()
clears the sequence (to prepare, for instance, a new elimination sequence)
Base class for undirected graphs.
Definition undiGraph.h:128
Base Class for all elimination sequence algorithms used by triangulations.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...