COPASI API  4.16.103
Public Member Functions | Protected Member Functions | Friends | List of all members
Cmt19937HR Class Reference

#include <Cmt19937.h>

Inheritance diagram for Cmt19937HR:
Inheritance graph
[legend]
Collaboration diagram for Cmt19937HR:
Collaboration graph
[legend]

Public Member Functions

C_FLOAT64 getRandomCC ()
 
C_FLOAT64 getRandomCO ()
 
C_FLOAT64 getRandomOO ()
 
- Public Member Functions inherited from Cmt19937
C_FLOAT64 genrand_res53 ()
 
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
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

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

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
 

Detailed Description

Definition at line 141 of file Cmt19937.h.

Constructor & Destructor Documentation

Cmt19937HR::Cmt19937HR ( unsigned C_INT32  seed)
protected

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

Parameters
C_INT32seed

Definition at line 248 of file Cmt19937.cpp.

248  :
249  Cmt19937(seed)
250 {}
Cmt19937(unsigned C_INT32 seed)
Definition: Cmt19937.cpp:75

Member Function Documentation

C_FLOAT64 Cmt19937HR::getRandomCC ( )
virtual

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

Returns
C_FLOAT64 random

Reimplemented from Cmt19937.

Definition at line 253 of file Cmt19937.cpp.

References C_INT32, Cmt19937::getRandomU(), and CRandom::mFloat.

254 {
255  unsigned C_INT32 a = getRandomU() >> 5, b = getRandomU() >> 6;
256  return mFloat = (a * 67108864.0 + b) * (1.0 / 9007199254740991.0);
257 }
C_FLOAT64 mFloat
Definition: CRandom.h:88
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 getRandomU()
Definition: Cmt19937.cpp:158
C_FLOAT64 Cmt19937HR::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 Cmt19937.

Definition at line 260 of file Cmt19937.cpp.

References C_INT32, Cmt19937::getRandomU(), and CRandom::mFloat.

261 {
262  unsigned C_INT32 a = getRandomU() >> 5, b = getRandomU() >> 6;
263  return mFloat = (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
264 }
C_FLOAT64 mFloat
Definition: CRandom.h:88
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 getRandomU()
Definition: Cmt19937.cpp:158
C_FLOAT64 Cmt19937HR::getRandomOO ( )
virtual

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

Returns
C_FLOAT64 random

Reimplemented from Cmt19937.

Definition at line 267 of file Cmt19937.cpp.

References C_INT32, Cmt19937::getRandomU(), and CRandom::mFloat.

268 {
269  unsigned C_INT32 a = getRandomU() >> 5, b = getRandomU() >> 6;
270  return mFloat = (a * 67108864.0 + b + 0.5) * (1.0 / 9007199254740992.0);
271 }
C_FLOAT64 mFloat
Definition: CRandom.h:88
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 getRandomU()
Definition: Cmt19937.cpp:158

Friends And Related Function Documentation

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

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