DUNE: Uniform Navigational Environment  2019.02.0
DUNE::Math::Random::MT19937 Class Reference

Detailed Description

Mersenne-Twister 19937 RNG - used in Matlab 7.4 onwards.

The 19937 number relates to its period (2^19937 - 1). See http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

The implementation is a slight adjustment of code by Takuji Nishimura and Makoto Matsumoto.

Public Member Functions

 MT19937 (void)
 
 MT19937 (int32_t seed)
 
 ~MT19937 (void)
 
int32_t random (void)
 
double uniform (void)
 
void seed (int32_t)
 
- Public Member Functions inherited from DUNE::Math::Random::Generator
virtual ~Generator ()
 
double uniform (double a, double b)
 
double gaussian (void)
 
double gaussian (double mu, double sigma)
 
void ballU (double radius, double *x, double *y)
 
void ballG (double sigma, double *x, double *y)
 

Additional Inherited Members

- Static Public Member Functions inherited from DUNE::Math::Random::Generator
static int32_t arbitrarySeed (void)
 
- Static Public Attributes inherited from DUNE::Math::Random::Generator
static const int32_t c_max_random
 

Constructor & Destructor Documentation

DUNE::Math::Random::MT19937::MT19937 ( void  )
DUNE::Math::Random::MT19937::MT19937 ( int32_t  seed)

References seed().

DUNE::Math::Random::MT19937::~MT19937 ( void  )

Member Function Documentation

int32_t DUNE::Math::Random::MT19937::random ( void  )
virtual

Generate a 32-bit signed integer, uniformly distributed in [0,c_max_random].

Returns
generated number.

Implements DUNE::Math::Random::Generator.

void DUNE::Math::Random::MT19937::seed ( int32_t  value)
virtual

Re-initialize generator with given seed.

Parameters
valuevalue for seed.

Implements DUNE::Math::Random::Generator.

References DUNE::Math::Random::Generator::c_max_random.

Referenced by MT19937().

double DUNE::Math::Random::MT19937::uniform ( void  )
virtual

Generate double-precision floating point number with uniform distribution in [0,1].

Default implementation returns value of random()/c_max_random.

Reimplemented from DUNE::Math::Random::Generator.

Collaboration diagram for DUNE::Math::Random::MT19937:
Collaboration graph