aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
aggregatorDecomposition.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
49
#ifndef GUM_AGGREGATORDECOMPOSITION_H
50
#define GUM_AGGREGATORDECOMPOSITION_H
51
52
#include <ctime>
53
54
#include <
agrum/BN/BayesNet.h
>
55
56
namespace
gum
{
62
template
< GUM_Numeric GUM_SCALAR >
63
class
AggregatorDecomposition
{
64
public
:
65
// ========================================================================
67
// ========================================================================
69
71
AggregatorDecomposition
();
72
74
virtual
~AggregatorDecomposition
();
75
76
BayesNet< GUM_SCALAR >&
getDecomposedAggregator
(BayesNet< GUM_SCALAR >& bn);
77
79
// ========================================================================
81
// ========================================================================
83
84
virtual
std::string
name
()
const
;
85
86
gum::Size
getMaximumArity
();
87
88
void
setMaximumArity
(
gum::Size
arity);
89
91
92
protected
:
93
// ========================================================================
95
// ========================================================================
97
NodeId
addAggregator_
(BayesNet< GUM_SCALAR >& bn,
98
std::string_view aggType,
99
const
DiscreteVariable
& var,
100
Idx
value);
101
102
BayesNet< GUM_SCALAR >&
decomposeAggregator_
(BayesNet< GUM_SCALAR >& bn,
NodeId
node);
103
104
Set< NodeId >
addDepthLayer_
(BayesNet< GUM_SCALAR >& bn,
105
Set< NodeId >
nodes,
106
NodeId
initialAggregator,
107
int
& j);
109
110
private
:
111
Size
_arity_
=
Size
(2);
112
};
113
114
115
#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
116
extern
template
class
AggregatorDecomposition< double >
;
117
#endif
118
119
}
/* namespace gum */
120
121
#include <
agrum/BN/inference/tools/aggregatorDecomposition_tpl.h
>
122
123
#endif
// GUM_AGGREGATORDECOMPOSITION_H
BayesNet.h
Class representing Bayesian networks.
aggregatorDecomposition_tpl.h
Inline implementation of AggregatorDecomposition.
gum::AggregatorDecomposition
<agrum/BN/inference/tools/aggregatorDecomposition.h>
Definition
aggregatorDecomposition.h:63
gum::AggregatorDecomposition::addDepthLayer_
Set< NodeId > addDepthLayer_(BayesNet< GUM_SCALAR > &bn, Set< NodeId > nodes, NodeId initialAggregator, int &j)
Definition
aggregatorDecomposition_tpl.h:224
gum::AggregatorDecomposition::decomposeAggregator_
BayesNet< GUM_SCALAR > & decomposeAggregator_(BayesNet< GUM_SCALAR > &bn, NodeId node)
Definition
aggregatorDecomposition_tpl.h:92
gum::AggregatorDecomposition::getMaximumArity
gum::Size getMaximumArity()
Definition
aggregatorDecomposition_tpl.h:350
gum::AggregatorDecomposition::getDecomposedAggregator
BayesNet< GUM_SCALAR > & getDecomposedAggregator(BayesNet< GUM_SCALAR > &bn)
Default constructor.
Definition
aggregatorDecomposition_tpl.h:70
gum::AggregatorDecomposition::addAggregator_
NodeId addAggregator_(BayesNet< GUM_SCALAR > &bn, std::string_view aggType, const DiscreteVariable &var, Idx value)
Definition
aggregatorDecomposition_tpl.h:83
gum::AggregatorDecomposition::_arity_
Size _arity_
Definition
aggregatorDecomposition.h:111
gum::AggregatorDecomposition::name
virtual std::string name() const
Definition
aggregatorDecomposition_tpl.h:355
gum::AggregatorDecomposition::AggregatorDecomposition
AggregatorDecomposition()
Default constructor.
Definition
aggregatorDecomposition_tpl.h:59
gum::AggregatorDecomposition::setMaximumArity
void setMaximumArity(gum::Size arity)
Definition
aggregatorDecomposition_tpl.h:344
gum::DiscreteVariable
Base class for discrete random variable.
Definition
discreteVariable.h:80
gum::Set< NodeId >
gum::Size
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition
types.h:74
gum::Idx
Size Idx
Type for indexes.
Definition
types.h:79
gum::NodeId
Size NodeId
Type for node ids.
Definition
graphElements.h:117
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0