13#ifndef ARCANE_CORE_RANDOM_UNIFORM01_H
14#define ARCANE_CORE_RANDOM_UNIFORM01_H
18#include "arcane/utils/FatalErrorException.h"
20#include "arcane/core/random/RandomGlobal.h"
25namespace Arcane::random
60template<
class UniformRandomNumberGenerator>
64 typedef UniformRandomNumberGenerator base_type;
65 typedef Real result_type;
66 static const bool has_fixed_range =
false;
68 explicit Uniform01(base_type & rng)
91 Real rng_val = _apply(_rng,_rng());
92 for(
int x=0;x<100;++x){
95 rng_val = _apply(_rng,_rng());
108 static ARCANE_DEPRECATED_122
Real apply(
const base_type& _rng,
typename base_type::result_type rng_val)
110 Real r = _apply(_rng,rng_val);
114 return (1.0-1.0e-10);
123 static Real _apply(
const base_type& _rng,
typename base_type::result_type rng_val)
125 return static_cast<Real>(rng_val - _rng.min()) /
126 (
static_cast<Real>(_rng.max()-_rng.min()) +
127 (std::numeric_limits<base_result>::is_integer ? 1.0 : 0.0));
132 typedef typename base_type::result_type base_result;
double Real
Type représentant un réel.