aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
multiDimFunctionGraphGenerator.h
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 Headers of gum::MultiDimFunctionGraphGenerator.
25  *
26  * @author Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
27  * @author Pierre-Henri WUILLEMIN(@LIP6) and Jean-Christophe MAGNAN and Christophe
28  * GONZALES(@AMU)
29  *
30  */
31 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_GENERATOR_H
32 #define GUM_MULTI_DIM_FUNCTION_GRAPH_GENERATOR_H
33 
34 #include <agrum/agrum.h>
35 #include <agrum/tools/multidim/implementations/multiDimFunctionGraph.h>
36 
37 namespace gum {
38  /**
39  * @class MultiDimFunctionGraphGenerator
40  * @ingroup multidim_group
41  *
42  * @brief Class implementing a function graph generator with template type
43  * double.
44  *
45  * @warning Doxygen does not like spanning command on multiple line, so we
46  * could not configure it with the correct include directive. Use the
47  * following code snippet to include this file.
48  * @code
49  * #include
50  * <agrum/tools/multidim/implementations/multiDimFunctionGraphGenerator.h>
51  * @endcode
52  *
53  */
55  public:
56  // =========================================================================
57  /// @name Constructors / Destructors
58  // =========================================================================
59 
60  /// @{
61  /**
62  * @brief Default constructor.
63  */
65  Idx minVar,
66  const Sequence< const DiscreteVariable* >& varSeq);
67 
68  /**
69  * @brief Class destructor.
70  */
72 
73  /// @}
74 
75  /**
76  * @brief Generates a MultiDimFunctionGraph.
77  */
78  MultiDimFunctionGraph< double >* generate();
79 
80 
81  private:
82  /**
83  * @brief Creates a leaf.
84  */
85  bool _createLeaf_(NodeId currentNodeId, HashTable< NodeId, Idx >& node2MinVar);
86 
87  /**
88  * @brief Generate a variable position.
89  */
91 
92  /// The variables
94 
95  /// The total number of variables
97 
98  /// The seed for random numbers
99  static Idx _genSeed_;
100  };
101 } // namespace gum
102 #endif /* GUM_MULTI_DIM_FUNCTION_GRAPH_GENERATOR_H */
Idx _nbTotalVar_
The total number of variables.
Class implementing a function graph generator with template type double.
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
MultiDimFunctionGraph< double > * generate()
Generates a MultiDimFunctionGraph.
bool _createLeaf_(NodeId currentNodeId, HashTable< NodeId, Idx > &node2MinVar)
Creates a leaf.
const Sequence< const DiscreteVariable *> _varSeq_
The variables.
static Idx _genSeed_
The seed for random numbers.
Idx _generateVarPos_(Idx offset, Idx span)
Generate a variable position.
MultiDimFunctionGraphGenerator(Idx maxVar, Idx minVar, const Sequence< const DiscreteVariable * > &varSeq)
Default constructor.