NDEVR
API Documentation
GaussianRN< ia, im, iq, ir, ntab >

Used to generate a random number over a Gaussian distribution with templated setup parameters for very quick speed. More...

Public Member Functions

 GaussianRN (sint08 didum)
 Constructs a Gaussian random number generator with the given seed.
fltp08 get ()
 Generates the next Gaussian-distributed random number.

Protected Member Functions

fltp08 gasdev (sint08 &idum)
 Generates a Gaussian-distributed random number using the Box-Muller transform.
fltp08 ran1 (sint08 &idum)
 Generates a uniform random number in the range [0, 1) using a Park-Miller minimal standard generator.

Detailed Description

template<sint04 ia = 16807, sint04 im = 2147483647, sint04 iq = 127773, sint04 ir = 2836, sint04 ntab = 32>
class GaussianRN< ia, im, iq, ir, ntab >

Used to generate a random number over a Gaussian distribution with templated setup parameters for very quick speed.


Definition at line 123 of file Random.h.

Constructor & Destructor Documentation

◆ GaussianRN()

template<sint04 ia = 16807, sint04 im = 2147483647, sint04 iq = 127773, sint04 ir = 2836, sint04 ntab = 32>
GaussianRN< ia, im, iq, ir, ntab >::GaussianRN ( sint08 didum)
inline

Constructs a Gaussian random number generator with the given seed.

Parameters
[in]didumThe seed value for the random number generator. Negated if positive.

Definition at line 130 of file Random.h.

Member Function Documentation

◆ gasdev()

template<sint04 ia = 16807, sint04 im = 2147483647, sint04 iq = 127773, sint04 ir = 2836, sint04 ntab = 32>
fltp08 GaussianRN< ia, im, iq, ir, ntab >::gasdev ( sint08 & idum)
inlineprotected

Generates a Gaussian-distributed random number using the Box-Muller transform.

Parameters
[in]idumThe seed state, modified in place on each call.
Returns
A pseudo-random number following a standard Gaussian distribution.

Definition at line 191 of file Random.h.

References ran1(), and sqrt().

Referenced by get().

◆ get()

template<sint04 ia = 16807, sint04 im = 2147483647, sint04 iq = 127773, sint04 ir = 2836, sint04 ntab = 32>
fltp08 GaussianRN< ia, im, iq, ir, ntab >::get ( )
inline

Generates the next Gaussian-distributed random number.

Returns
A pseudo-random number following a Gaussian distribution.

Definition at line 138 of file Random.h.

References gasdev().

◆ ran1()

template<sint04 ia = 16807, sint04 im = 2147483647, sint04 iq = 127773, sint04 ir = 2836, sint04 ntab = 32>
fltp08 GaussianRN< ia, im, iq, ir, ntab >::ran1 ( sint08 & idum)
inlineprotected

Generates a uniform random number in the range [0, 1) using a Park-Miller minimal standard generator.

Parameters
[in]idumThe seed state, modified in place on each call.
Returns
A uniform pseudo-random number in [0, 1).

Definition at line 148 of file Random.h.

Referenced by gasdev().


The documentation for this class was generated from the following file: