Simpatico  v1.10
List of all members | Public Member Functions
Util::MTRand_int32 Class Reference

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.

#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...
 

Constructor & Destructor Documentation

Util::MTRand_int32::MTRand_int32 ( )

Default constructor.

Definition at line 13 of file mtrand.cpp.

References seed().

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().

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().

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

Copy constructor.

Definition at line 49 of file mtrand.cpp.

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.

References operator()(), seed(), and serialize().

Member Function Documentation

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

Assignment.

Definition at line 61 of file mtrand.cpp.

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(), seed(), and ~MTRand_int32().

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

Seed with array.

Definition at line 98 of file mtrand.cpp.

References seed().

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.

Referenced by ~MTRand_int32().

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.

Referenced by ~MTRand_int32().


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