RandomLib
1.10
|
The uniform distribution for MPFR. More...
#include <RandomLib/MPFRUniform.hpp>
Public Member Functions | |
MPFRUniform () | |
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 uniform distribution for MPFR.
This is just a thin layer on top of MPFRRandom to provide random numbers uniformly distributed in [0,1].
This class uses a mutable private object. So a single MPFRUniform object cannot safely be used by multiple threads. In a multi-processing environment, each thread should use a thread-specific MPFRUniform object.
bits | the number of bits in each digit. |
Definition at line 33 of file MPFRUniform.hpp.
|
inline |
Initialize the MPFRUniform object.
Definition at line 39 of file MPFRUniform.hpp.
|
inline |
Sample from the uniform distribution in [0,1] returning a MPFRRandom. This function takes an unused GMP random generator as a parameter, in order to parallel the usage of MPFRExponential and MPFRNormal.
[out] | t | the MPFRRandom result. |
[in,out] | r | a GMP random generator (unused). |
Definition at line 48 of file MPFRUniform.hpp.
|
inline |
Sample from the uniform distribution in [0,1].
[out] | val | the sample from the uniform distribution |
[in,out] | r | a GMP random generator. |
[in] | round | the rounding direction. |
Definition at line 59 of file MPFRUniform.hpp.