aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
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-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
49#ifndef AGRUM_AGGREGATORDECOMPOSITION_H
50#define AGRUM_AGGREGATORDECOMPOSITION_H
51
52#include <ctime>
53
54#include <agrum/BN/BayesNet.h>
55
56namespace gum {
62 template < typename GUM_SCALAR >
64 public:
65 // ========================================================================
67 // ========================================================================
69
72
75
76 BayesNet< GUM_SCALAR >& getDecomposedAggregator(BayesNet< GUM_SCALAR >& bn);
77
79 // ========================================================================
81 // ========================================================================
83
84 virtual std::string name() const;
85
87
88 void setMaximumArity(gum::Size arity);
89
91
92 protected:
93 // ========================================================================
95 // ========================================================================
97 NodeId addAggregator_(BayesNet< GUM_SCALAR >& bn,
98 const std::string& 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:
112 };
113
114
115#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
116 extern template class AggregatorDecomposition< double >;
117#endif
118
119} /* namespace gum */
120
122
123#endif // AGRUM_AGGREGATORDECOMPOSITION_H
Class representing Bayesian networks.
Inline implementation of AggregatorDecomposition.
<agrum/BN/inference/tools/aggregatorDecomposition.h>
Set< NodeId > addDepthLayer_(BayesNet< GUM_SCALAR > &bn, Set< NodeId > nodes, NodeId initialAggregator, int &j)
BayesNet< GUM_SCALAR > & decomposeAggregator_(BayesNet< GUM_SCALAR > &bn, NodeId node)
BayesNet< GUM_SCALAR > & getDecomposedAggregator(BayesNet< GUM_SCALAR > &bn)
Default constructor.
NodeId addAggregator_(BayesNet< GUM_SCALAR > &bn, const std::string &aggType, const DiscreteVariable &var, Idx value)
Base class for discrete random variable.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
Size Idx
Type for indexes.
Definition types.h:79
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46