Scythe-1.0.3
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
scythe::mersenne Class Reference

The Mersenne Twister random number generator. More...

#include <scythestat/rng/mersenne.h>

Inheritance diagram for scythe::mersenne:
Inheritance graph
[legend]
Collaboration diagram for scythe::mersenne:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mersenne (const mersenne &m)
 Copy constructor.
void initialize (unsigned long s)
 Sets the seed.
double runif ()
 Generate a random uniform variate on (0, 1).
template<matrix_order O, matrix_style S>
Matrix< double, O, S > runif (unsigned int rows, unsigned int cols)
 Generate a Matrix of random uniform variates.
Matrix< double, Col, Concrete > runif (unsigned int rows, unsigned int cols)
 Generate a Matrix of random uniform variates.
unsigned long genrand_int32 ()
 Generate a random long integer.

Static Public Member Functions

 mersenne ()
 Default constructor.

Protected Attributes

unsigned long mt [N]
int mti

Static Protected Attributes

static const int N = 624
static const int M = 398

Detailed Description

The Mersenne Twister random number generator.

This class defines a random number generator, using the Mersenne Twister algorithm developed and implemented by Makoto Matsumoto and Takuji Nishimura (1997, 2002). The period of this random number generator is $2^{19937} - 1$.

The mersenne class extends Scythe's basic random number generating class, scythe::rng, implementing the interface that it defines.

See also:
rng
lecuyer

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