COPASI API
4.16.103
|
#include <Cr250.h>
Public Member Functions | |
C_FLOAT64 | getRandomCC () |
C_FLOAT64 | getRandomCO () |
C_FLOAT64 | getRandomOO () |
C_INT32 | getRandomS () |
unsigned C_INT32 | getRandomU () |
void | initialize (unsigned C_INT32 seed=CRandom::getSystemSeed()) |
~Cr250 () | |
![]() | |
const unsigned C_INT32 & | getModulus () 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::Type & | getType () const |
virtual | ~CRandom () |
Private Member Functions | |
Cr250 (unsigned C_INT32 seed) | |
C_FLOAT64 | dr250 (void) |
unsigned C_INT16 | myrand () |
unsigned C_INT32 | r250 (void) |
unsigned C_INT32 | r250n (const unsigned C_INT16 &max) |
Private Attributes | |
unsigned C_INT16 | mBuffer [250] |
C_INT32 | mIndex |
unsigned C_INT32 | mSeed |
Friends | |
CRandom * | CRandom::createGenerator (CRandom::Type type, unsigned C_INT32 seed) |
Additional Inherited Members | |
![]() | |
enum | Type { r250 = 0, mt19937, mt19937HR, unkown } |
![]() | |
static CRandom * | createGenerator (CRandom::Type type=CRandom::mt19937, unsigned C_INT32 seed=0) |
static unsigned C_INT32 | getSystemSeed () |
![]() | |
static const std::string | TypeName [] |
static const char * | XMLType [] |
![]() | |
CRandom () | |
void | setModulus (const unsigned C_INT32 &modulus) |
![]() | |
C_FLOAT64 | mFloat |
unsigned C_INT32 | mModulus |
C_FLOAT64 | mModulusInv |
C_FLOAT64 | mModulusInv1 |
C_INT32 | mNumberS |
unsigned C_INT32 | mNumberU |
CRandom::Type | mType |
Cr250 class implementing the R250 random number generator, by W. L. Maier
Created for Copasi by Stefan Hoops (C) Stefan Hoops 2002
|
private |
Default/Named constructor. Seeds the random number generator with the given seed.
C_INT32 | seed |
Definition at line 54 of file Cr250.cpp.
References initialize(), and CRandom::setModulus().
Number returned by dr250() is in range [0,1)
Definition at line 147 of file Cr250.cpp.
References CRandom::mNumberU, and r250().
Referenced by getRandomCO().
|
virtual |
Produces a uniformly distributed random number in 0 <= x <= 1.
Reimplemented from CRandom.
Definition at line 103 of file Cr250.cpp.
References CRandom::mModulusInv, and r250().
|
virtual |
Produces a uniformly distributed random number in 0 <= x < 1. Note: 0 < x <= 1 may be achieved by 1.0 - getRandomCO().
Reimplemented from CRandom.
Definition at line 106 of file Cr250.cpp.
References dr250().
|
virtual |
Produces a uniformly distributed random number in 0 < x < 1.
Reimplemented from CRandom.
Definition at line 109 of file Cr250.cpp.
References CRandom::mModulusInv1, and r250().
|
virtual |
|
virtual |
|
virtual |
Initialize or reinitialize the random number generator with the given seed. Note: seed = 12345 gives the default initilization as in W. L. Maier code
unsigned | C_INT32 seed (default system seed) |
Reimplemented from CRandom.
Definition at line 63 of file Cr250.cpp.
References mBuffer, mIndex, mSeed, and myrand().
Referenced by Cr250().
|
private |
Linear congruent pseudorandom number generator for initialization. Return a pseudorandom number in the interval 0 <= n <= 32767.
Definition at line 153 of file Cr250.cpp.
References mSeed.
Referenced by initialize().
Number returned by r250() is in the interval 0 <= k <= 65535.
Definition at line 112 of file Cr250.cpp.
References C_INT16, mBuffer, mIndex, and CRandom::mNumberU.
Referenced by dr250(), getRandomCC(), getRandomOO(), getRandomS(), getRandomU(), and r250n().
|
friend |
|
private |
Definition at line 34 of file Cr250.h.
Referenced by initialize(), and r250().
|
private |
Definition at line 30 of file Cr250.h.
Referenced by initialize(), and r250().
|
private |
Definition at line 32 of file Cr250.h.
Referenced by initialize(), and myrand().