aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
o4DGContext.cpp
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
52
53namespace gum {
54
55 // First 140 prime numbers...
56 // see e.g.
57 // http://en.wikipedia.org/wiki/List_of_prime_numbers#The_first_500_prime_numbers
58 // if more is needed...
59 // Don't forget to change _nbLogPrime_ to match number of log2 of prime
60 // numbers in that table.
62
63 const double O4DGContext::_logPrime_[]
64 = {std::log2(2.0), std::log2(3.0), std::log2(5.0), std::log2(7.0), std::log2(11.0),
65 std::log2(13.0), std::log2(17.0), std::log2(19.0), std::log2(23.0), std::log2(29.0),
66 std::log2(31.0), std::log2(37.0), std::log2(41.0), std::log2(43.0), std::log2(47.0),
67 std::log2(53.0), std::log2(59.0), std::log2(61.0), std::log2(67.0), std::log2(71.0),
68 std::log2(73.0), std::log2(79.0), std::log2(83.0), std::log2(89.0), std::log2(97.0),
69 std::log2(101.0), std::log2(103.0), std::log2(107.0), std::log2(109.0), std::log2(113.0),
70 std::log2(127.0), std::log2(131.0), std::log2(137.0), std::log2(139.0), std::log2(149.0),
71 std::log2(151.0), std::log2(157.0), std::log2(163.0), std::log2(167.0), std::log2(173.0),
72 std::log2(179.0), std::log2(181.0), std::log2(191.0), std::log2(193.0), std::log2(197.0),
73 std::log2(199.0), std::log2(211.0), std::log2(223.0), std::log2(227.0), std::log2(229.0),
74 std::log2(233.0), std::log2(239.0), std::log2(241.0), std::log2(251.0), std::log2(257.0),
75 std::log2(263.0), std::log2(269.0), std::log2(271.0), std::log2(277.0), std::log2(281.0),
76 std::log2(283.0), std::log2(293.0), std::log2(307.0), std::log2(311.0), std::log2(313.0),
77 std::log2(317.0), std::log2(331.0), std::log2(337.0), std::log2(347.0), std::log2(349.0),
78 std::log2(353.0), std::log2(359.0), std::log2(367.0), std::log2(373.0), std::log2(379.0),
79 std::log2(383.0), std::log2(389.0), std::log2(397.0), std::log2(401.0), std::log2(409.0),
80 std::log2(419.0), std::log2(421.0), std::log2(431.0), std::log2(433.0), std::log2(439.0),
81 std::log2(443.0), std::log2(449.0), std::log2(457.0), std::log2(461.0), std::log2(463.0),
82 std::log2(467.0), std::log2(479.0), std::log2(487.0), std::log2(491.0), std::log2(499.0),
83 std::log2(503.0), std::log2(509.0), std::log2(521.0), std::log2(523.0), std::log2(541.0),
84 std::log2(547.0), std::log2(557.0), std::log2(563.0), std::log2(569.0), std::log2(571.0),
85 std::log2(577.0), std::log2(587.0), std::log2(593.0), std::log2(599.0), std::log2(601.0),
86 std::log2(607.0), std::log2(613.0), std::log2(617.0), std::log2(619.0), std::log2(631.0),
87 std::log2(641.0), std::log2(643.0), std::log2(647.0), std::log2(653.0), std::log2(659.0),
88 std::log2(661.0), std::log2(673.0), std::log2(677.0), std::log2(683.0), std::log2(691.0),
89 std::log2(701.0), std::log2(709.0), std::log2(719.0), std::log2(727.0), std::log2(733.0),
90 std::log2(739.0), std::log2(743.0), std::log2(751.0), std::log2(757.0), std::log2(761.0),
91 std::log2(769.0), std::log2(773.0), std::log2(787.0), std::log2(797.0), std::log2(809.0)};
92
96
97 // Default constructor.
98 O4DGContext::O4DGContext(Idx* varInst, Idx nbVar) :
100 GUM_CONSTRUCTOR(O4DGContext);
101 _varInstantiation_ = varInst;
102 _nbVar_ = nbVar;
103 }
104
105 // Default Destructor.
107 GUM_DESTRUCTOR(O4DGContext);
108 ;
109 }
110
111} // namespace gum
112
113#ifdef GUM_NO_INLINE
115#endif
static const Idx _offset2_
NodeId _DG2ExploredNode_
DG2 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.
static const Idx _nbLogPrime_
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
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Class used to manipulate o4DGContext in Function Graph Operations.
Class used to manipulate o4DGContext in Function Graph Operations.