aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
o4DGContext.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
50
51#ifndef O4DGCONTEXT_H
52#define O4DGCONTEXT_H
53
54#include <agrum/agrum.h>
55
57
58namespace gum {
59
60 // clang-format off
68 // clang-format on
69
71 public:
72 // ============================================================================
74 // ============================================================================
76
81
86
90 void* operator new(size_t s);
91
95 void operator delete(void* p);
97
98 // ============================================================================
100 // ============================================================================
101
104 void setDG1Node(const NodeId&);
105
107 const NodeId& DG1Node() const { return _DG1ExploredNode_; }
108
110 void setDG2Node(const NodeId&);
111
113 const NodeId& DG2Node() const { return _DG2ExploredNode_; }
114
116
117 // ============================================================================
119 // ============================================================================
121
123 void chgVarModality(Idx, Idx);
124
127
129 // ============================================================================
131 // ============================================================================
133
135 const double& key(short int* instNeeded);
136
138
139 private:
142
145
150
152 double _key_;
153
155 static const double _logPrime_[];
157 };
158} // namespace gum
159
160#ifndef GUM_NO_INLINE
162#endif /* GUM_NO_INLINE */
163
164#endif // O4DGCONTEXT_H
const NodeId & DG2Node() const
Get DG2 diagram current explored Node.
void setDG2Node(const NodeId &)
Set DG2 diagram current explored Node.
static const Idx _offset2_
const NodeId & DG1Node() const
Get DG1 diagram current explored Node.
NodeId _DG2ExploredNode_
DG2 Diagram current explored node.
void chgVarModality(Idx, Idx)
Changes given variable modality.
void setDG1Node(const NodeId &)
Set DG1 diagram current explored Node.
~O4DGContext()
Default destructor.
static const Idx _offset1_
double _key_
The key use to store the context as a key in the hashtable.
const double & key(short int *instNeeded)
Returns o4DGContext key.
static const Idx _nbLogPrime_
Idx varModality(Idx)
Changes given variable modality.
static const double _logPrime_[]
Table containing the log2 of prime numbers.
static const Idx _offsetv_
Idx * _varInstantiation_
Vector containing for each retrograde variable its current modality 0 meaning no instantiation done =...
NodeId _DG1ExploredNode_
DG1 Diagram current explored node.
O4DGContext(Idx *, Idx)
Default constructor.
Size Idx
Type for indexes.
Definition types.h:79
Size NodeId
Type for node ids.
Headers of MultiDimFunctionGraph.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Class used to manipulate o4DGContext in Function Graph Operations.