COPASI API  4.40.278
Cmt19937 Class Reference

#include <Cmt19937.h>

Inheritance diagram for Cmt19937:
[legend]

Public Member Functions

C_FLOAT64 genrand_res53 ()
 
C_FLOAT64 getRandomCC ()
 
C_FLOAT64 getRandomCO ()
 
C_FLOAT64 getRandomOO ()
 
C_INT32 getRandomS ()
 
unsigned C_INT32 getRandomU ()
 
void init_by_array (unsigned C_INT32 init_key[], C_INT32 key_length)
 
void initialize (unsigned C_INT32 seed=CRandom::getSystemSeed())
 
 ~Cmt19937 ()
 
- Public Member Functions inherited from CRandom
CRandomcopy ()
 
const unsigned C_INT32getModulus () const
 
virtual C_FLOAT64 getRandomExp ()
 
virtual C_FLOAT64 getRandomGamma (C_FLOAT64 shape, C_FLOAT64 scale)
 
virtual C_FLOAT64 getRandomNormal (const C_FLOAT64 &mean, const C_FLOAT64 &sd)
 
virtual C_FLOAT64 getRandomNormal01 ()
 
virtual C_FLOAT64 getRandomNormalLog (const C_FLOAT64 &mean, const C_FLOAT64 &sd)
 
virtual C_FLOAT64 getRandomNormalPositive (const C_FLOAT64 &mean, const C_FLOAT64 &sd)
 
virtual C_FLOAT64 getRandomPoisson (const C_FLOAT64 &mean)
 
virtual C_INT32 getRandomS (const C_INT32 &max)
 
virtual C_FLOAT64 getRandomStdGamma (C_FLOAT64 shape)
 
virtual unsigned C_INT32 getRandomU (const unsigned C_INT32 &max)
 
const CRandom::TypegetType () const
 
virtual ~CRandom ()
 

Protected Member Functions

 Cmt19937 (unsigned C_INT32 seed)
 
void next_state ()
 
- Protected Member Functions inherited from CRandom
 CRandom ()
 
void setModulus (const unsigned C_INT32 &modulus)
 

Private Attributes

C_INT mLeft
 
unsigned C_INT32mNext
 
unsigned C_INT32 mState [624]
 

Friends

CRandomCRandom::createGenerator (CRandom::Type type, unsigned C_INT32 seed)
 

Additional Inherited Members

- Public Types inherited from CRandom
enum  Type { r250 = 0 , mt19937 , mt19937HR , unkown }
 
- Static Public Member Functions inherited from CRandom
static CRandomcreateGenerator (CRandom::Type type=CRandom::mt19937, unsigned C_INT32 seed=0)
 
static unsigned C_INT32 getSystemSeed ()
 
- Static Public Attributes inherited from CRandom
static const std::string TypeName []
 
static const char * XMLType []
 
- Protected Attributes inherited from CRandom
C_FLOAT64 mFloat
 
unsigned C_INT32 mModulus
 
C_FLOAT64 mModulusInv
 
C_FLOAT64 mModulusInv1
 
C_INT32 mNumberS
 
unsigned C_INT32 mNumberU
 
CRandom::Type mType
 

Constructor & Destructor Documentation

◆ Cmt19937()

Cmt19937::Cmt19937 ( unsigned C_INT32  seed)
protected

Default/Named constructor. Seeds the random number generator with the given seed.

Parameters
C_INT32seed

References initialize(), and CRandom::setModulus().

◆ ~Cmt19937()

Cmt19937::~Cmt19937 ( )

The destructor.

Member Function Documentation

◆ genrand_res53()

C_FLOAT64 Cmt19937::genrand_res53 ( )

◆ getRandomCC()

C_FLOAT64 Cmt19937::getRandomCC ( )
virtual

Produces a uniformly distributed random number in 0 <= x <= 1.

Returns
C_FLOAT64 random

Reimplemented from CRandom.

Reimplemented in Cmt19937HR.

References C_FLOAT64, mLeft, mNext, CRandom::mNumberU, and next_state().

◆ getRandomCO()

C_FLOAT64 Cmt19937::getRandomCO ( )
virtual

Produces a uniformly distributed random number in 0 <= x < 1. Note: 0 < x <= 1 may be achieved by 1.0 - getRandomCO().

Returns
C_FLOAT64 random

Reimplemented from CRandom.

Reimplemented in Cmt19937HR.

References C_FLOAT64, mLeft, mNext, CRandom::mNumberU, and next_state().

◆ getRandomOO()

C_FLOAT64 Cmt19937::getRandomOO ( )
virtual

Produces a uniformly distributed random number in 0 < x < 1.

Returns
C_FLOAT64 random

Reimplemented from CRandom.

Reimplemented in Cmt19937HR.

References C_FLOAT64, mLeft, mNext, CRandom::mNumberU, and next_state().

◆ getRandomS()

C_INT32 Cmt19937::getRandomS ( )
virtual

Get a random number in 0 <= n <= (Modulus & 0x7ffffff)

Returns
C_INT32 random

Reimplemented from CRandom.

References mLeft, mNext, CRandom::mNumberU, and next_state().

◆ getRandomU()

unsigned C_INT32 Cmt19937::getRandomU ( )
virtual

Get a random number in 0 <= n <= Modulus

Returns
unsigned C_INT32 random

Reimplemented from CRandom.

References mLeft, mNext, CRandom::mNumberU, and next_state().

Referenced by genrand_res53(), Cmt19937HR::getRandomCC(), Cmt19937HR::getRandomCO(), and Cmt19937HR::getRandomOO().

◆ init_by_array()

void Cmt19937::init_by_array ( unsigned C_INT32  init_key[],
C_INT32  key_length 
)

References Cmt19937_N, initialize(), mLeft, and mState.

◆ initialize()

void Cmt19937::initialize ( unsigned C_INT32  seed = CRandom::getSystemSeed())
virtual

Initialize or reinitialize the random number generator with the given seed.

Parameters
unsignedC_INT32 seed (default system seed)

Reimplemented from CRandom.

References Cmt19937_N, mLeft, and mState.

Referenced by Cmt19937(), and init_by_array().

◆ next_state()

void Cmt19937::next_state ( )
protected

Friends And Related Function Documentation

◆ CRandom::createGenerator

CRandom* CRandom::createGenerator ( CRandom::Type  type,
unsigned C_INT32  seed 
)
friend

Member Data Documentation

◆ mLeft

◆ mNext

unsigned C_INT32* Cmt19937::mNext
private

◆ mState

unsigned C_INT32 Cmt19937::mState[624]
private

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