Class implements Mersenne Twister RNG. More...

#include <mersenneTwister.hpp>

Inheritance diagram for julian::MersenneTwister:
julian::UniformRNG

Public Member Functions

 MersenneTwister ()
 Constructor. More...
 
 MersenneTwister (const MersenneTwister &)
 Copy constructor. More...
 
MersenneTwisteroperator= (MersenneTwister)
 Copy assignment operator. More...
 
virtual double getRandom ()
 generate one random variable from uniform distribution. More...
 
virtual std::vector< double > getRandoms (int)
 generate n random variables from uniform distribution. More...
 
virtual void setSeed (unsigned int)
 sets seed of RNG More...
 
virtual MersenneTwisterclone () const
 Virtual copy constructor. More...
 
virtual ~MersenneTwister ()
 destructor More...
 
- Public Member Functions inherited from julian::UniformRNG
virtual ~UniformRNG ()
 destructor More...
 

Private Attributes

gsl_rng * rnd_
 GSL random number generator. More...
 

Detailed Description

Class implements Mersenne Twister RNG.

Class implements Mersenne Twister algorithm (known as MT19937). See [30]

Remarks
Class uses algorithms implemented in GSL

Constructor & Destructor Documentation

julian::MersenneTwister::MersenneTwister ( )

Constructor.

in constructor we create the GSL MersenneTwister algorithm

julian::MersenneTwister::MersenneTwister ( const MersenneTwister orig)

Copy constructor.

One need to explicitly define copy constructor to avoid memory-leak.

julian::MersenneTwister::~MersenneTwister ( )
virtual

destructor

One need to explicitly define destructor to avoid memory-leak.

Member Function Documentation

MersenneTwister * julian::MersenneTwister::clone ( ) const
virtual

Virtual copy constructor.

Method is an implementation of virtual copy constructor.

Reimplemented from julian::UniformRNG.

double julian::MersenneTwister::getRandom ( )
virtual

generate one random variable from uniform distribution.

Implements julian::UniformRNG.

std::vector< double > julian::MersenneTwister::getRandoms ( int  n)
virtual

generate n random variables from uniform distribution.

Implements julian::UniformRNG.

MersenneTwister & julian::MersenneTwister::operator= ( MersenneTwister  orig)

Copy assignment operator.

One need to explicitly define Copy constructor to avoid memory-leak.

void julian::MersenneTwister::setSeed ( unsigned int  seed)
virtual

sets seed of RNG

Implements julian::UniformRNG.

Member Data Documentation

gsl_rng* julian::MersenneTwister::rnd_
private

GSL random number generator.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/mathematics/RNGs/mersenneTwister.hpp
  • C:/Unix/home/OEM/jULIAN/src/mathematics/RNGs/mersenneTwister.cpp