PSCF v1.1
Public Member Functions | List of all members
Util::MTRand_int32 Class Reference

Mersenne Twister random number generator engine. More...

#include <mtrand.h>

Inheritance diagram for Util::MTRand_int32:
Util::MTRand Util::MTRand53 Util::MTRand_closed Util::MTRand_open

Public Member Functions

 MTRand_int32 ()
 Default constructor. More...
 
 MTRand_int32 (unsigned long s)
 Constructor with 32 bit int as seed. More...
 
 MTRand_int32 (const unsigned long *array, int size)
 Constructor with array of size 32 bit ints as seed. More...
 
 MTRand_int32 (const MTRand_int32 &)
 Copy constructor. More...
 
void operator= (const MTRand_int32 &)
 Assignment. More...
 
virtual ~MTRand_int32 ()
 Destructor. More...
 
void seed (unsigned long)
 Seed with 32 bit integer. More...
 
void seed (const unsigned long *, int size)
 Seed with array. More...
 
unsigned long operator() ()
 Overload operator() to make this a generator (functor) More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize to/from an archive. More...
 

Detailed Description

Mersenne Twister random number generator engine.

Generates unsigned long integers randomly distributed over the range 0 < i < 2^{32} - 1.

Definition at line 70 of file mtrand.h.

Constructor & Destructor Documentation

◆ MTRand_int32() [1/4]

Util::MTRand_int32::MTRand_int32 ( )

Default constructor.

Definition at line 13 of file mtrand.cpp.

References seed().

◆ MTRand_int32() [2/4]

Util::MTRand_int32::MTRand_int32 ( unsigned long  s)

Constructor with 32 bit int as seed.

Definition at line 25 of file mtrand.cpp.

References seed().

◆ MTRand_int32() [3/4]

Util::MTRand_int32::MTRand_int32 ( const unsigned long *  array,
int  size 
)

Constructor with array of size 32 bit ints as seed.

Definition at line 37 of file mtrand.cpp.

References seed().

◆ MTRand_int32() [4/4]

Util::MTRand_int32::MTRand_int32 ( const MTRand_int32 other)

Copy constructor.

Definition at line 49 of file mtrand.cpp.

◆ ~MTRand_int32()

virtual Util::MTRand_int32::~MTRand_int32 ( )
inlinevirtual

Destructor.

2007-02-11: made the destructor virtual; Thanks "double more" for pointing this out

Definition at line 105 of file mtrand.h.

Member Function Documentation

◆ operator=()

void Util::MTRand_int32::operator= ( const MTRand_int32 other)

Assignment.

Definition at line 61 of file mtrand.cpp.

◆ seed() [1/2]

void Util::MTRand_int32::seed ( unsigned long  s)

Seed with 32 bit integer.

Definition at line 86 of file mtrand.cpp.

Referenced by MTRand_int32(), and seed().

◆ seed() [2/2]

void Util::MTRand_int32::seed ( const unsigned long *  array,
int  size 
)

Seed with array.

Definition at line 98 of file mtrand.cpp.

References seed().

◆ operator()()

unsigned long Util::MTRand_int32::operator() ( )
inline

Overload operator() to make this a generator (functor)

Generate 32 bit random int, public method.

Definition at line 197 of file mtrand.h.

◆ serialize()

template<class Archive >
void Util::MTRand_int32::serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize to/from an archive.

Definition at line 185 of file mtrand.h.


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