aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
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-2026 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-2026 *
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
53
#include <
agrum/base/graphs/algorithms/triangulations/eliminationStrategies/orderedEliminationSequenceStrategy.h
>
54
#include <
agrum/base/graphs/algorithms/triangulations/junctionTreeStrategies/defaultJunctionTreeStrategy.h
>
55
#include <
agrum/base/graphs/algorithms/triangulations/staticTriangulation.h
>
56
57
namespace
gum
{
58
59
67
class
GUM_SHARED_PUBLIC
OrderedTriangulation
:
public
StaticTriangulation
{
68
public
:
69
// ############################################################################
71
// ############################################################################
73
75
80
OrderedTriangulation
(
const
OrderedEliminationSequenceStrategy
& elimSeq
81
=
OrderedEliminationSequenceStrategy
(),
82
const
JunctionTreeStrategy
& JTStrategy =
DefaultJunctionTreeStrategy
(),
83
bool
minimality =
false
);
84
86
103
OrderedTriangulation
(
const
UndiGraph
*
graph
,
104
const
NodeProperty< Size >
* domsizes,
105
const
std::vector< NodeId >* sequence,
106
const
OrderedEliminationSequenceStrategy
& elimSeq
107
=
OrderedEliminationSequenceStrategy
(),
108
const
JunctionTreeStrategy
& JTStrategy =
DefaultJunctionTreeStrategy
(),
109
bool
minimality =
false
);
110
112
OrderedTriangulation
(
const
OrderedTriangulation
& from);
113
115
OrderedTriangulation
(
OrderedTriangulation
&& from);
116
123
[[nodiscard]]
OrderedTriangulation
*
newFactory
()
const
final
;
124
126
[[nodiscard]]
OrderedTriangulation
*
copyFactory
()
const
final
;
127
129
~OrderedTriangulation
()
override
;
130
132
133
// ############################################################################
135
// ############################################################################
137
139
146
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
void
initTriangulation_
(
UndiGraph
&
graph
)
final
;
167
168
170
171
const
std::vector< NodeId >*
_order_
{
nullptr
};
172
174
175
private
:
177
OrderedTriangulation
&
operator=
(
const
OrderedTriangulation
&);
178
};
179
180
}
/* namespace gum */
181
182
#endif
/* GUM_ORDERED_TRIANGULATION_H */
gum::DefaultJunctionTreeStrategy
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
Definition
defaultJunctionTreeStrategy.h:63
gum::JunctionTreeStrategy
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
Definition
junctionTreeStrategy.h:66
gum::OrderedEliminationSequenceStrategy
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
Definition
orderedEliminationSequenceStrategy.h:65
gum::OrderedTriangulation::operator=
OrderedTriangulation & operator=(const OrderedTriangulation &)
forbid copy operator
gum::OrderedTriangulation::setOrder
virtual void setOrder(const std::vector< NodeId > *order) final
sets the sequence of elimination (only the reference is stored)
Definition
orderedTriangulation.cpp:119
gum::OrderedTriangulation::_order_
const std::vector< NodeId > * _order_
the elimination sequence to apply
Definition
orderedTriangulation.h:171
gum::OrderedTriangulation::initTriangulation_
void initTriangulation_(UndiGraph &graph) final
the function called to initialize the triangulation process
Definition
orderedTriangulation.cpp:126
gum::OrderedTriangulation::OrderedTriangulation
OrderedTriangulation(const OrderedEliminationSequenceStrategy &elimSeq=OrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false)
default constructor
Definition
orderedTriangulation.cpp:56
gum::OrderedTriangulation::newFactory
OrderedTriangulation * newFactory() const final
returns a fresh triangulation over the same graph and of the same type as the current object (using t...
Definition
orderedTriangulation.cpp:93
gum::OrderedTriangulation::setGraph
void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes) final
initialize the triangulation data structures for a new graph
Definition
orderedTriangulation.cpp:111
gum::OrderedTriangulation::copyFactory
OrderedTriangulation * copyFactory() const final
virtual copy constructor
Definition
orderedTriangulation.cpp:100
gum::StaticTriangulation::StaticTriangulation
StaticTriangulation(const EliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor: without any graph
Definition
staticTriangulation.cpp:86
gum::UndiGraph
Base class for undirected graphs.
Definition
undiGraph.h:130
defaultJunctionTreeStrategy.h
An algorithms producing a junction given the elimination tree produced by the triangulation algorithm...
gum::NodeProperty
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Definition
graphElements.h:407
gum::graph
Definition
bayesBall.h:79
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
orderedEliminationSequenceStrategy.h
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
staticTriangulation.h
base class for all non-incremental triangulations.
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0