MTToolBox  0.2.10
Public Member Functions
MTToolBox::MersenneTwister64 Class Reference

Mersenne Twister pseudo random number generator. More...

#include <MersenneTwister64.hpp>

Inheritance diagram for MTToolBox::MersenneTwister64:
MTToolBox::AbstractGenerator< uint64_t >

Public Member Functions

 MersenneTwister64 ()
 Constructor without arguments. More...
 
 MersenneTwister64 (uint64_t value)
 Constructor with a integer seed. More...
 
 MersenneTwister64 (const std::string &value)
 Constructor with a string seed. More...
 
 MersenneTwister64 (const uint64_t *value, int size)
 Constructor with an array of integer. More...
 
 ~MersenneTwister64 ()
 Destructor. More...
 
void seed (uint64_t value)
 Initialization by 64-bit integer. More...
 
void seed (const std::string &value)
 Initialization by a string. More...
 
void seed (const uint64_t *value, int key_length)
 Initialization by an array of unsigned integers. More...
 
template<class T >
void seed_array (const T *init_key, int key_length)
 Initialization by an array of T type. More...
 
uint64_t generate ()
 Generates pseudo random number. More...
 
uint64_t next ()
 Generates pseudo random number. More...
 
int bitSize () const
 Returns 19937, which is size of internal state. More...
 
- Public Member Functions inherited from MTToolBox::AbstractGenerator< uint64_t >
virtual ~AbstractGenerator ()
 Virtual destructor (always required) More...
 

Detailed Description

Mersenne Twister pseudo random number generator.

Constructor & Destructor Documentation

MTToolBox::MersenneTwister64::MersenneTwister64 ( )
inline

Constructor without arguments.

References seed().

MTToolBox::MersenneTwister64::MersenneTwister64 ( uint64_t  value)
inline

Constructor with a integer seed.

Parameters
[in]valueSeed of initialization

References seed().

MTToolBox::MersenneTwister64::MersenneTwister64 ( const std::string &  value)
inline

Constructor with a string seed.

Parameters
[in]valueSeed of initialization

References seed().

MTToolBox::MersenneTwister64::MersenneTwister64 ( const uint64_t *  value,
int  size 
)
inline

Constructor with an array of integer.

Parameters
[in]valueSeed of initialization
[in]sizelength of value

References seed().

MTToolBox::MersenneTwister64::~MersenneTwister64 ( )
inline

Destructor.

Member Function Documentation

int MTToolBox::MersenneTwister64::bitSize ( ) const
inlinevirtual

Returns 19937, which is size of internal state.

Returns
Always 19937

Implements MTToolBox::AbstractGenerator< uint64_t >.

uint64_t MTToolBox::MersenneTwister64::generate ( )
inlinevirtual

Generates pseudo random number.

Returns
a 64-bit unsigned integer

Implements MTToolBox::AbstractGenerator< uint64_t >.

References next().

uint64_t MTToolBox::MersenneTwister64::next ( )
inline

Generates pseudo random number.

Returns
a 64-bit unsigned integer

Referenced by generate().

void MTToolBox::MersenneTwister64::seed ( uint64_t  value)
inlinevirtual

Initialization by 64-bit integer.

Parameters
[in]valueSeed of initialization

Implements MTToolBox::AbstractGenerator< uint64_t >.

Referenced by MersenneTwister64(), and seed_array().

void MTToolBox::MersenneTwister64::seed ( const std::string &  value)
inline

Initialization by a string.

Parameters
[in]valueSeed of initialization
void MTToolBox::MersenneTwister64::seed ( const uint64_t *  value,
int  key_length 
)
inline

Initialization by an array of unsigned integers.

Parameters
[in]valueSeed of initialization
[in]key_lengthLength of value
template<class T >
void MTToolBox::MersenneTwister64::seed_array ( const T *  init_key,
int  key_length 
)
inline

Initialization by an array of T type.

Template Parameters
Ttype of element of value
Parameters
[in]init_keySeed of initialization
key_lengthLength of value

References seed().


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