Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
#include <MersenneTwister.hpp>
Public Types | |
enum | { N = 624 } |
enum | { SAVE = N + 1 } |
typedef unsigned long | uint32 |
Public Member Functions | |
MersenneTwister (const uint32 oneSeed) | |
MersenneTwister (uint32 *const bigSeed, uint32 const seedLength=N) | |
MersenneTwister () | |
MersenneTwister (const MersenneTwister &o) | |
uint32 | randInt () |
uint32 | randInt (const uint32 n) |
double | rand () |
double | rand (const double n) |
double | randExc () |
double | randExc (const double n) |
double | randDblExc () |
double | randDblExc (const double n) |
double | operator() () |
double | rand53 () |
double | randNorm (const double mean=0.0, const double stddev=1.0) |
void | seed (const uint32 oneSeed) |
void | seed (uint32 *const bigSeed, const uint32 seedLength=N) |
void | seed () |
void | save (uint32 *saveArray) const |
void | load (uint32 *const loadArray) |
MersenneTwister & | operator= (const MersenneTwister &o) |
Protected Types | |
enum | { M = 397 } |
Protected Member Functions | |
void | initialize (const uint32 oneSeed) |
void | reload () |
uint32 | hiBit (const uint32 u) const |
uint32 | loBit (const uint32 u) const |
uint32 | loBits (const uint32 u) const |
uint32 | mixBits (const uint32 u, const uint32 v) const |
uint32 | magic (const uint32 u) const |
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 | |
uint32 | state [N] |
uint32 * | pNext |
int | left |
Friends | |
std::ostream & | operator<< (std::ostream &os, const MersenneTwister &mtrand) |
std::istream & | operator>> (std::istream &is, MersenneTwister &mtrand) |
Definition at line 86 of file MersenneTwister.hpp.
typedef unsigned long vl::MersenneTwister::uint32 |
Definition at line 90 of file MersenneTwister.hpp.
anonymous enum |
Definition at line 92 of file MersenneTwister.hpp.
anonymous enum |
Definition at line 93 of file MersenneTwister.hpp.
anonymous enum [protected] |
Definition at line 96 of file MersenneTwister.hpp.
vl::MersenneTwister::MersenneTwister | ( | const uint32 | oneSeed ) | [inline] |
Definition at line 282 of file MersenneTwister.hpp.
References seed().
vl::MersenneTwister::MersenneTwister | ( | uint32 *const | bigSeed, |
uint32 const | seedLength = N |
||
) | [inline] |
Definition at line 285 of file MersenneTwister.hpp.
References seed().
vl::MersenneTwister::MersenneTwister | ( | ) | [inline] |
Definition at line 288 of file MersenneTwister.hpp.
References seed().
vl::MersenneTwister::MersenneTwister | ( | const MersenneTwister & | o ) | [inline] |
MersenneTwister::uint32 vl::MersenneTwister::randInt | ( | ) | [inline] |
Definition at line 301 of file MersenneTwister.hpp.
References left, pNext, and reload().
Referenced by vl::Random::fillRandomMersenneTwister(), rand(), rand53(), randDblExc(), randExc(), randInt(), vl::randomI32(), and vl::randomU32().
MersenneTwister::uint32 vl::MersenneTwister::randInt | ( | const uint32 | n ) | [inline] |
Definition at line 317 of file MersenneTwister.hpp.
References randInt().
double vl::MersenneTwister::rand | ( | ) | [inline] |
Definition at line 336 of file MersenneTwister.hpp.
References randInt().
Referenced by operator()(), rand(), and randNorm().
double vl::MersenneTwister::rand | ( | const double | n ) | [inline] |
Definition at line 339 of file MersenneTwister.hpp.
References rand().
double vl::MersenneTwister::randExc | ( | ) | [inline] |
double vl::MersenneTwister::randExc | ( | const double | n ) | [inline] |
Definition at line 345 of file MersenneTwister.hpp.
References randExc().
double vl::MersenneTwister::randDblExc | ( | ) | [inline] |
Definition at line 348 of file MersenneTwister.hpp.
References randInt().
Referenced by randDblExc().
double vl::MersenneTwister::randDblExc | ( | const double | n ) | [inline] |
Definition at line 351 of file MersenneTwister.hpp.
References randDblExc().
double vl::MersenneTwister::operator() | ( | ) | [inline] |
Definition at line 376 of file MersenneTwister.hpp.
References rand().
double vl::MersenneTwister::rand53 | ( | ) | [inline] |
Definition at line 354 of file MersenneTwister.hpp.
References randInt().
Referenced by vl::random().
double vl::MersenneTwister::randNorm | ( | const double | mean = 0.0 , |
const double | stddev = 1.0 |
||
) | [inline] |
Definition at line 360 of file MersenneTwister.hpp.
References vl::log(), rand(), and vl::sqrt().
void vl::MersenneTwister::seed | ( | const uint32 | oneSeed ) | [inline] |
Definition at line 217 of file MersenneTwister.hpp.
References initialize(), and reload().
Definition at line 224 of file MersenneTwister.hpp.
References initialize(), N, reload(), and state.
void vl::MersenneTwister::seed | ( | ) | [inline] |
Definition at line 259 of file MersenneTwister.hpp.
References hash(), N, and NULL.
Referenced by MersenneTwister().
void vl::MersenneTwister::save | ( | uint32 * | saveArray ) | const [inline] |
Definition at line 381 of file MersenneTwister.hpp.
void vl::MersenneTwister::load | ( | uint32 *const | loadArray ) | [inline] |
MersenneTwister & vl::MersenneTwister::operator= | ( | const MersenneTwister & | o ) | [inline] |
void vl::MersenneTwister::initialize | ( | const uint32 | oneSeed ) | [inline, protected] |
void vl::MersenneTwister::reload | ( | ) | [inline, protected] |
Definition at line 145 of file MersenneTwister.hpp.
Referenced by mixBits().
Definition at line 146 of file MersenneTwister.hpp.
Referenced by magic().
Definition at line 147 of file MersenneTwister.hpp.
Referenced by mixBits().
Definition at line 148 of file MersenneTwister.hpp.
References hiBit(), and loBits().
Referenced by twist().
uint32 vl::MersenneTwister::twist | ( | const uint32 | m, |
const uint32 | s0, | ||
const uint32 | s1 | ||
) | const [inline, protected] |
Definition at line 152 of file MersenneTwister.hpp.
References magic(), and mixBits().
Referenced by reload().
MersenneTwister::uint32 vl::MersenneTwister::hash | ( | time_t | t, |
clock_t | c | ||
) | [inline, static, protected] |
Definition at line 159 of file MersenneTwister.hpp.
Referenced by seed().
std::ostream& operator<< | ( | std::ostream & | os, |
const MersenneTwister & | mtrand | ||
) | [friend] |
Definition at line 400 of file MersenneTwister.hpp.
std::istream& operator>> | ( | std::istream & | is, |
MersenneTwister & | mtrand | ||
) | [friend] |
Definition at line 408 of file MersenneTwister.hpp.
uint32 vl::MersenneTwister::state[N] [protected] |
Definition at line 98 of file MersenneTwister.hpp.
Referenced by initialize(), load(), MersenneTwister(), vl::operator<<(), operator=(), vl::operator>>(), reload(), save(), and seed().
uint32* vl::MersenneTwister::pNext [protected] |
Definition at line 99 of file MersenneTwister.hpp.
Referenced by load(), MersenneTwister(), operator=(), vl::operator>>(), randInt(), and reload().
int vl::MersenneTwister::left [protected] |
Definition at line 100 of file MersenneTwister.hpp.
Referenced by load(), MersenneTwister(), vl::operator<<(), operator=(), vl::operator>>(), randInt(), reload(), and save().