aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
partialOrderedTriangulation.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
52
#ifndef GUM_PARTIAL_ORDERED_TRIANGULATION_H
53
#define GUM_PARTIAL_ORDERED_TRIANGULATION_H
54
55
#include <
agrum/base/graphs/algorithms/triangulations/eliminationStrategies/defaultPartialOrderedEliminationSequenceStrategy.h
>
56
#include <
agrum/base/graphs/algorithms/triangulations/junctionTreeStrategies/defaultJunctionTreeStrategy.h
>
57
#include <
agrum/base/graphs/algorithms/triangulations/staticTriangulation.h
>
58
59
namespace
gum
{
60
61
72
class
GUM_SHARED_PUBLIC
PartialOrderedTriangulation
:
public
StaticTriangulation
{
73
public
:
74
// ############################################################################
76
// ############################################################################
78
80
85
PartialOrderedTriangulation
(
const
PartialOrderedEliminationSequenceStrategy
& elimSeq
86
=
DefaultPartialOrderedEliminationSequenceStrategy
(),
87
const
JunctionTreeStrategy
& JTStrategy
88
=
DefaultJunctionTreeStrategy
(),
89
bool
minimality =
false
);
90
92
108
PartialOrderedTriangulation
(
const
UndiGraph
*
graph
,
109
const
NodeProperty< Size >
* domsizes,
110
const
List< NodeSet >
* partial_order,
111
const
PartialOrderedEliminationSequenceStrategy
& elimSeq
112
=
DefaultPartialOrderedEliminationSequenceStrategy
(),
113
const
JunctionTreeStrategy
& JTStrategy
114
=
DefaultJunctionTreeStrategy
(),
115
bool
minimality =
false
);
116
118
PartialOrderedTriangulation
(
const
PartialOrderedTriangulation
& from);
119
121
PartialOrderedTriangulation
(
PartialOrderedTriangulation
&& from);
122
129
[[nodiscard]]
PartialOrderedTriangulation
*
newFactory
()
const override
;
130
132
[[nodiscard]]
PartialOrderedTriangulation
*
copyFactory
()
const
final
;
133
135
~PartialOrderedTriangulation
()
override
;
136
138
139
140
// ############################################################################
142
// ############################################################################
144
146
153
void
setGraph
(
const
UndiGraph
*
graph
,
const
NodeProperty< Size >
* domsizes)
final
;
154
157
159
virtual
void
setPartialOrder
(
const
List< NodeSet >
* partial_order)
final
;
160
162
163
164
protected
:
166
175
void
initTriangulation_
(
UndiGraph
&
graph
)
final
;
176
178
const
List< NodeSet >
*
_partial_order_
{
nullptr
};
179
181
182
private
:
184
PartialOrderedTriangulation
&
operator=
(
const
PartialOrderedTriangulation
&);
185
};
186
187
}
/* namespace gum */
188
189
#endif
/* GUM_PARTIAL_ORDERED_TRIANGULATION_H */
gum::DefaultJunctionTreeStrategy
An algorithm producing a junction given the elimination tree produced by a triangulation algorithm.
Definition
defaultJunctionTreeStrategy.h:63
gum::DefaultPartialOrderedEliminationSequenceStrategy
An Elimination sequence algorithm that imposes a given partial ordering on the nodes elimination sequ...
Definition
defaultPartialOrderedEliminationSequenceStrategy.h:100
gum::JunctionTreeStrategy
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
Definition
junctionTreeStrategy.h:66
gum::List
Generic doubly linked lists.
Definition
list.h:378
gum::PartialOrderedEliminationSequenceStrategy
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
Definition
partialOrderedEliminationSequenceStrategy.h:73
gum::PartialOrderedTriangulation::newFactory
PartialOrderedTriangulation * newFactory() const override
returns a fresh triangulation (over an empty graph) of the same type as the current object
Definition
partialOrderedTriangulation.cpp:97
gum::PartialOrderedTriangulation::setPartialOrder
virtual void setPartialOrder(const List< NodeSet > *partial_order) final
sets the elimination sequence's partial order (only a reference is stored)
Definition
partialOrderedTriangulation.cpp:124
gum::PartialOrderedTriangulation::setGraph
void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes) final
initialize the triangulation data structures for a new graph
Definition
partialOrderedTriangulation.cpp:116
gum::PartialOrderedTriangulation::operator=
PartialOrderedTriangulation & operator=(const PartialOrderedTriangulation &)
forbid copy operator
gum::PartialOrderedTriangulation::copyFactory
PartialOrderedTriangulation * copyFactory() const final
virtual copy constructor
Definition
partialOrderedTriangulation.cpp:105
gum::PartialOrderedTriangulation::PartialOrderedTriangulation
PartialOrderedTriangulation(const PartialOrderedEliminationSequenceStrategy &elimSeq=DefaultPartialOrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false)
default constructor
Definition
partialOrderedTriangulation.cpp:56
gum::PartialOrderedTriangulation::_partial_order_
const List< NodeSet > * _partial_order_
the partial ordering to apply to eliminate nodes
Definition
partialOrderedTriangulation.h:178
gum::PartialOrderedTriangulation::initTriangulation_
void initTriangulation_(UndiGraph &graph) final
the function called to initialize the triangulation process
Definition
partialOrderedTriangulation.cpp:131
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...
defaultPartialOrderedEliminationSequenceStrategy.h
An Elimination sequence algorithm that imposes a given partial ordering on the nodes elimination sequ...
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
staticTriangulation.h
base class for all non-incremental triangulations.
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0