aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
o4DGContext.cpp
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /**
23  * @file
24  * @brief Class used to manipulate o4DGContext in Function Graph Operations
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  * @author Pierre-Henri WUILLEMIN(@LIP6) and Jean-Christophe MAGNAN and Christophe
28  * GONZALES(@AMU)
29  */
30 
31 #include <agrum/tools/multidim/utils/FunctionGraphUtilities/operators/o4DGContext.h>
32 
33 namespace gum {
34 
35  // First 140 prime numbers...
36  // see e.g.
37  // http://en.wikipedia.org/wiki/List_of_prime_numbers#The_first_500_prime_numbers
38  // if more is needed...
39  // Don't forget to change _nbLogPrime_ to match number of log2 of prime
40  // numbers in that table.
41  const Idx O4DGContext::_nbLogPrime_ = 140;
42 
43  const double O4DGContext::_logPrime_[]
44  = {log2(2), log2(3), log2(5), log2(7), log2(11), log2(13), log2(17), log2(19),
45  log2(23), log2(29), log2(31), log2(37), log2(41), log2(43), log2(47), log2(53),
46  log2(59), log2(61), log2(67), log2(71), log2(73), log2(79), log2(83), log2(89),
47  log2(97), log2(101), log2(103), log2(107), log2(109), log2(113), log2(127), log2(131),
48  log2(137), log2(139), log2(149), log2(151), log2(157), log2(163), log2(167), log2(173),
49  log2(179), log2(181), log2(191), log2(193), log2(197), log2(199), log2(211), log2(223),
50  log2(227), log2(229), log2(233), log2(239), log2(241), log2(251), log2(257), log2(263),
51  log2(269), log2(271), log2(277), log2(281), log2(283), log2(293), log2(307), log2(311),
52  log2(313), log2(317), log2(331), log2(337), log2(347), log2(349), log2(353), log2(359),
53  log2(367), log2(373), log2(379), log2(383), log2(389), log2(397), log2(401), log2(409),
54  log2(419), log2(421), log2(431), log2(433), log2(439), log2(443), log2(449), log2(457),
55  log2(461), log2(463), log2(467), log2(479), log2(487), log2(491), log2(499), log2(503),
56  log2(509), log2(521), log2(523), log2(541), log2(547), log2(557), log2(563), log2(569),
57  log2(571), log2(577), log2(587), log2(593), log2(599), log2(601), log2(607), log2(613),
58  log2(617), log2(619), log2(631), log2(641), log2(643), log2(647), log2(653), log2(659),
59  log2(661), log2(673), log2(677), log2(683), log2(691), log2(701), log2(709), log2(719),
60  log2(727), log2(733), log2(739), log2(743), log2(751), log2(757), log2(761), log2(769),
61  log2(773), log2(787), log2(797), log2(809)};
62 
66 
67  // Default constructor.
72  _nbVar_ = nbVar;
73  }
74 
75  // Default Destructor.
78  ;
79  }
80 
81 } // namespace gum
82 
83 #ifdef GUM_NO_INLINE
84 # include <agrum/tools/multidim/utils/FunctionGraphUtilities/operators/o4DGContext_inl.h>
85 #endif
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643