56class NormalDistribution
60 typedef UniformRandomNumberGenerator base_type;
62 explicit NormalDistribution(base_type & rng,
Real mean = 0.0,
Real sigma = 1.0)
63 : _rng(rng), _mean(mean), _sigma(sigma), _valid(
false)
68 NormalDistribution(
const NormalDistribution& other)
69 : _rng(other._rng), _mean(other._mean), _sigma(other._sigma), _valid(
false)
85 const double pi = 3.14159265358979323846;
87 return _cached_rho * (_valid ? cos(2*pi*_r1) : sin(2*pi*_r1)) * _sigma + _mean;
93 const Real _mean, _sigma;
96 Real _cached_rho = 0.0;