The normal distribution for MPFR (Kahn algorithm). More...
|void||operator() (MPFRRandom< bits > &t, gmp_randstate_t r) const|
|int||operator() (mpfr_t val, gmp_randstate_t r, mpfr_rnd_t round) const|
The normal distribution for MPFR (Kahn algorithm).
This class is DEPRECATED. It is included for illustrative purposes only. The MPFRNormal class provides a somewhat more efficient method for sampling from the normal distribution.
N.B. Damien Stehle' drew my attention to this algorithm as a useful way to compute normal deviates exactly.
This class uses mutable private objects. So a single MPFRNormalK object cannot safely be used by multiple threads. In a multi-processing environment, each thread should use a thread-specific MPFRNormalK object.
|bits||the number of bits in each digit.|
Sample from the normal distribution with mean 0 and variance 1.
|[out]||val||the sample from the normal distribution|
|[in,out]||r||a GMP random generator.|
|[in]||round||the rounding direction.|