aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
orderedTriangulation.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
48#ifndef GUM_ORDERED_TRIANGULATION_H
49#define GUM_ORDERED_TRIANGULATION_H
50
51#include <vector>
52
56
57namespace gum {
58
59
68 public:
69 // ############################################################################
71 // ############################################################################
73
75
83 bool minimality = false);
84
86
103 OrderedTriangulation(const UndiGraph* graph,
104 const NodeProperty< Size >* domsizes,
105 const std::vector< NodeId >* sequence,
109 bool minimality = false);
110
113
116
123 virtual OrderedTriangulation* newFactory() const final;
124
126 virtual OrderedTriangulation* copyFactory() const final;
127
129 virtual ~OrderedTriangulation();
130
132
133 // ############################################################################
135 // ############################################################################
137
139
146 virtual void setGraph(const UndiGraph* graph, const NodeProperty< Size >* domsizes) final;
147
149
151 virtual void setOrder(const std::vector< NodeId >* order) final;
152
154
155 protected:
157
166 virtual void initTriangulation_(UndiGraph& graph) final;
167
168
170
171 const std::vector< NodeId >* _order_{nullptr};
172
174
175 private:
178 };
179
180} /* namespace gum */
181
182#endif /* GUM_ORDERED_TRIANGULATION_H */
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
OrderedTriangulation & operator=(const OrderedTriangulation &)
forbid copy operator
virtual void setOrder(const std::vector< NodeId > *order) final
sets the sequence of elimination (only the reference is stored)
const std::vector< NodeId > * _order_
the elimination sequence to apply
virtual ~OrderedTriangulation()
destructor
virtual void initTriangulation_(UndiGraph &graph) final
the function called to initialize the triangulation process
OrderedTriangulation(const OrderedEliminationSequenceStrategy &elimSeq=OrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false)
default constructor
virtual OrderedTriangulation * newFactory() const final
returns a fresh triangulation over the same graph and of the same type as the current object (using t...
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes) final
initialize the triangulation data structures for a new graph
virtual OrderedTriangulation * copyFactory() const final
virtual copy constructor
StaticTriangulation(const EliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor: without any graph
Base class for undirected graphs.
Definition undiGraph.h:128
An algorithms producing a junction given the elimination tree produced by the triangulation algorithm...
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
base class for all non-incremental triangulations.