aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
fusionContext.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// =========================================================================
50#ifndef GUM_FUSION_CONTEXT_H
51#define GUM_FUSION_CONTEXT_H
52// =========================================================================
53// =========================================================================
54// =========================================================================
57
58// =========================================================================
59
60namespace gum {
61
69
71
72 template < bool isInitial = false >
74 public:
75 // ==========================================================================
77 // ==========================================================================
79
80 // ###################################################################
82 // ###################################################################
84
85 // ###################################################################
87 // ###################################################################
89
90 // ============================================================================
92 // ============================================================================
93 void* operator new(size_t s);
94
95 void operator delete(void* p);
96
98
99 // ==========================================================================
101 // ==========================================================================
103
104 // ###################################################################
106 // ###################################################################
107
108 public:
110
111 private:
113
115
116 // ###################################################################
118 // ###################################################################
119
120 public:
122
123 private:
125
127
128 // ###################################################################
130 // ###################################################################
131
132 public:
134
135 private:
137
139
140 public:
142
143 private:
145
147
148 // ###################################################################
152 // ###################################################################
153
154 public:
156
157 private:
159
161
163
164 public:
165 // ==========================================================================
167 // ==========================================================================
169
170 // ###################################################################
172 // ###################################################################
173 bool addPair(LeafPair* p);
174
175 // ###################################################################
177 // ###################################################################
178 bool updatePair(LeafPair* p);
179
180 // ###################################################################
182 // ###################################################################
183 bool removePair(LeafPair* p);
184
186
188
190
191 // ==========================================================================
193 // ==========================================================================
195
196 // ###################################################################
198 // ###################################################################
199 LeafPair* top();
200
201 // ###################################################################
203 // ###################################################################
204 double topLikelyhood();
205
207
208 // ==========================================================================
210 // ==========================================================================
212
213 // ###################################################################
215 // ###################################################################
217
218 // ###################################################################
220 // ###################################################################
222
223 // ###################################################################
225 // ###################################################################
226
227 public:
229
230 private:
232
234
236
237 public:
238 std::string toString();
239
240 private:
242
244
246 };
247
248
249} /* namespace gum */
250
252
253#endif // GUM_FUSION_CONTEXT_H
<agrum/FMDP/learning/datastructure/leaves/abstractLeaf.h>
bool _containsAssociatedLeaf_(AbstractLeaf *l, Int2Type< false >)
pair_iterator endPairs()
bool addPair(LeafPair *p)
bool removePair(LeafPair *p)
Set< LeafPair * > _associatedPairs_(Int2Type< false >)
FusionContext(AbstractLeaf *)
Default constructor.
MultiPriorityQueue< LeafPair *, double, std::less< double > > _pairsHeap_
bool updatePair(LeafPair *p)
AbstractLeaf * leaf()
bool updateAssociatedLeaf(AbstractLeaf *l)
bool _deassociateLeaf_(AbstractLeaf *, Int2Type< false >)
LeafPair * leafAssociatedPair(AbstractLeaf *l)
bool _updateAllAssociatedLeaves_(Int2Type< false >)
bool containsAssociatedLeaf(AbstractLeaf *l)
~FusionContext()
Default destructor.
AbstractLeaf * _leaf_
bool deassociateLeaf(AbstractLeaf *l)
pair_iterator beginPairs()
Set< LeafPair * > associatedPairs()
bool _updateAssociatedLeaf_(AbstractLeaf *, Int2Type< false >)
bool associateLeaf(AbstractLeaf *l)
bool _associateLeaf_(AbstractLeaf *, Int2Type< false >)
HashTable< AbstractLeaf *, LeafPair * > _leaf2Pair_
Safe Const Iterators for hashtables.
Definition hashTable.h:1662
The class for generic Hash Tables.
Definition hashTable.h:640
<agrum/FMDP/learning/datastructure/leaves/leafPair.h>
Definition leafPair.h:69
A MultiPriorityQueue is a heap in which each element has a mutable priority and duplicates are allowe...
Representation of a set.
Definition set.h:129
Templates for fusion context class.
Headers of the leaf pair class.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
HashTableConstIteratorSafe< LeafPair *, std::vector< Size > > pair_iterator
Template trick for efficient development.