15#ifndef ARCANE_CORE_RANDOM_INVERSIVECONGRUENTIAL_H
16#define ARCANE_CORE_RANDOM_INVERSIVECONGRUENTIAL_H
20#include "arcane/utils/FatalErrorException.h"
22#include "arcane/core/random/RandomGlobal.h"
27namespace Arcane::random
47template<
typename IntType, IntType a, IntType c, IntType m, IntType val>
51 typedef IntType result_type;
52 static const bool has_fixed_range =
true;
53 static const result_type min_value = ( c == 0 ? 1 : 0 );
54 static const result_type max_value = m-1;
62 result_type
min()
const {
return c == 0 ? 1 : 0; }
70 result_type
max()
const {
return m-1; }
90 void seed(IntType x0) { _x = x0; }
124 return x = do_mod::mult_add(a,do_mod::invert(x), c);
142 {
return _x == rhs._x; }
152typedef InversiveCongruential<
Int32, 9102, 2147483647-36884165,
153 2147483647, 0> Hellekalek1995;
result_type max() const
Retourne la valeur maximum possible d'une séquence.
result_type min() const
Retourne la valeur minimum possible d'une séquence.
IntType operator()()
Surdéfinition de l'opérateur () qui retourne la valeur pseudo aléatoire du générateur....
bool validation(IntType x) const
Fonction de validation (je ne sais pas trop a quoi elle sert!)
static IntType apply(IntType x)
Retourne la valeur pseudo aléatoire à partir de l'état x. Le membre privée _x du générateur n'est pas...
void seed(IntType x0)
Initialisation de la graine du générateur à partir de la valeur x0.
bool operator==(const InversiveCongruential &rhs) const
Surdéfinition de l'opérateur ==.
IntType getState() const
Méthode qui retourne l'état générateur.
InversiveCongruential(IntType x0=1)
Constructeur avec initialisation de la graine à partir de la valeur x0.
std::int32_t Int32
Type entier signé sur 32 bits.