|
SUMO - Simulation of Urban MObility
|
#include <MersenneTwister.h>
Public Types | |
| enum | { N = 624 } |
| enum | { SAVE = N + 1 } |
| typedef unsigned long | uint32 |
Public Member Functions | |
| void | load (uint32 *const loadArray) |
| MTRand (const uint32 &oneSeed) | |
| MTRand (uint32 *const bigSeed, uint32 const seedLength=N) | |
| MTRand () | |
| double | operator() () |
| double | rand () |
| double | rand (const double &n) |
| double | rand53 () |
| double | randDblExc () |
| double | randDblExc (const double &n) |
| double | randExc () |
| double | randExc (const double &n) |
| uint32 | randInt (const uint32 &n) |
| uint32 | randInt () |
| double | randNorm (const double &mean=0.0, const double &variance=0.0) |
| void | save (uint32 *saveArray) const |
| void | seed (const uint32 oneSeed) |
| void | seed (uint32 *const bigSeed, const uint32 seedLength=N) |
| void | seed () |
Protected Types | |
| enum | { M = 397 } |
Protected Member Functions | |
| uint32 | hiBit (const uint32 &u) const |
| void | initialize (const uint32 oneSeed) |
| uint32 | loBit (const uint32 &u) const |
| uint32 | loBits (const uint32 &u) const |
| uint32 | mixBits (const uint32 &u, const uint32 &v) const |
| void | reload () |
| uint32 | twist (const uint32 &m, const uint32 &s0, const uint32 &s1) const |
Static Protected Member Functions | |
| static uint32 | hash (time_t t, clock_t c) |
Protected Attributes | |
| int | left |
| uint32 * | pNext |
| uint32 | state [N] |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const MTRand &mtrand) |
| std::istream & | operator>> (std::istream &is, MTRand &mtrand) |
Definition at line 74 of file MersenneTwister.h.
| typedef unsigned long MTRand::uint32 |
Definition at line 77 of file MersenneTwister.h.
| anonymous enum |
Definition at line 79 of file MersenneTwister.h.
| anonymous enum |
Definition at line 80 of file MersenneTwister.h.
anonymous enum [protected] |
Definition at line 83 of file MersenneTwister.h.
| MTRand::MTRand | ( | const uint32 & | oneSeed | ) | [inline] |
Definition at line 142 of file MersenneTwister.h.
References seed().
Definition at line 145 of file MersenneTwister.h.
References seed().
| MTRand::MTRand | ( | ) | [inline] |
Definition at line 148 of file MersenneTwister.h.
References seed().
| MTRand::uint32 MTRand::hash | ( | time_t | t, |
| clock_t | c | ||
| ) | [inline, static, protected] |
Definition at line 323 of file MersenneTwister.h.
Referenced by seed().
Definition at line 131 of file MersenneTwister.h.
Referenced by mixBits().
| void MTRand::initialize | ( | const uint32 | oneSeed | ) | [inline, protected] |
| void MTRand::load | ( | uint32 *const | loadArray | ) | [inline] |
Definition at line 132 of file MersenneTwister.h.
Referenced by twist().
Definition at line 133 of file MersenneTwister.h.
Referenced by mixBits().
Definition at line 134 of file MersenneTwister.h.
References hiBit(), and loBits().
Referenced by twist().
| double MTRand::operator() | ( | ) | [inline] |
Definition at line 109 of file MersenneTwister.h.
References rand().
| double MTRand::rand | ( | ) | [inline] |
Definition at line 151 of file MersenneTwister.h.
References randInt().
Referenced by operator()(), and rand().
| double MTRand::rand | ( | const double & | n | ) | [inline] |
Definition at line 154 of file MersenneTwister.h.
References rand().
| double MTRand::rand53 | ( | ) | [inline] |
Definition at line 169 of file MersenneTwister.h.
References randInt().
| double MTRand::randDblExc | ( | ) | [inline] |
Definition at line 163 of file MersenneTwister.h.
References randInt().
Referenced by randDblExc(), and randNorm().
| double MTRand::randDblExc | ( | const double & | n | ) | [inline] |
Definition at line 166 of file MersenneTwister.h.
References randDblExc().
| double MTRand::randExc | ( | const double & | n | ) | [inline] |
Definition at line 160 of file MersenneTwister.h.
References randExc().
| double MTRand::randExc | ( | ) | [inline] |
Definition at line 157 of file MersenneTwister.h.
References randInt().
Referenced by RandHelper::rand(), randExc(), and randNorm().
| MTRand::uint32 MTRand::randInt | ( | const uint32 & | n | ) | [inline] |
Definition at line 200 of file MersenneTwister.h.
References randInt().
| MTRand::uint32 MTRand::randInt | ( | ) | [inline] |
Definition at line 184 of file MersenneTwister.h.
References left, pNext, and reload().
Referenced by RandHelper::rand(), rand(), rand53(), randDblExc(), randExc(), and randInt().
| double MTRand::randNorm | ( | const double & | mean = 0.0, |
| const double & | variance = 0.0 |
||
| ) | [inline] |
Definition at line 175 of file MersenneTwister.h.
References randDblExc(), and randExc().
Referenced by RandHelper::randNorm().
| void MTRand::reload | ( | ) | [inline, protected] |
| void MTRand::save | ( | uint32 * | saveArray | ) | const [inline] |
Definition at line 349 of file MersenneTwister.h.
| void MTRand::seed | ( | ) | [inline] |
| void MTRand::seed | ( | const uint32 | oneSeed | ) | [inline] |
Definition at line 220 of file MersenneTwister.h.
References initialize(), and reload().
Referenced by RandHelper::initRandGlobal().
Definition at line 228 of file MersenneTwister.h.
References initialize(), N, reload(), and state.
| uint32 MTRand::twist | ( | const uint32 & | m, |
| const uint32 & | s0, | ||
| const uint32 & | s1 | ||
| ) | const [inline, protected] |
Definition at line 136 of file MersenneTwister.h.
References loBit(), and mixBits().
Referenced by reload().
| std::ostream& operator<< | ( | std::ostream & | os, |
| const MTRand & | mtrand | ||
| ) | [friend] |
Definition at line 370 of file MersenneTwister.h.
| std::istream& operator>> | ( | std::istream & | is, |
| MTRand & | mtrand | ||
| ) | [friend] |
Definition at line 379 of file MersenneTwister.h.
int MTRand::left [protected] |
Definition at line 87 of file MersenneTwister.h.
Referenced by load(), operator<<(), operator>>(), randInt(), reload(), and save().
uint32* MTRand::pNext [protected] |
Definition at line 86 of file MersenneTwister.h.
Referenced by load(), operator>>(), randInt(), and reload().
uint32 MTRand::state[N] [protected] |
Definition at line 85 of file MersenneTwister.h.
Referenced by initialize(), load(), operator<<(), operator>>(), reload(), save(), and seed().