53 template <
typename GUM_SCALAR >
59 std::vector< GUM_SCALAR > v(n + 1);
60 std::vector< GUM_SCALAR > res(n);
61 v[0] = (GUM_SCALAR)0.0;
62 v[n] = (GUM_SCALAR)1.0;
63 for (
Idx i = 1; i < n; i++) {
66 std::sort(v.begin(), v.end());
68 for (
Idx i = 0; i < n; i++) {
69 res[i] = v[i + 1] - v[i];
75 template <
typename GENERATOR >
77 std::uniform_int_distribution< Idx > uni_int(0, max - 1);
78 return uni_int(generator);
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Idx randomValue(const Size max=2)
Returns a random Idx between 0 and max-1 included.
double randomProba()
Returns a random double between 0 and 1 included (i.e.
std::vector< GUM_SCALAR > randomDistribution(Size n)
Return a random discrete distribution.
gum is the global namespace for all aGrUM entities