Visualization Library 2.1.0
A 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) |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
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 |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Static Protected Member Functions | |
static uint32 | hash (time_t t, clock_t c) |
Protected Attributes | |
uint32 | state [N] |
uint32 * | pNext |
int | left |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
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 |
Enumerator | |
---|---|
N |
Definition at line 92 of file MersenneTwister.hpp.
anonymous enum |
Enumerator | |
---|---|
SAVE |
Definition at line 93 of file MersenneTwister.hpp.
|
protected |
Enumerator | |
---|---|
M |
Definition at line 96 of file MersenneTwister.hpp.
|
inline |
Definition at line 282 of file MersenneTwister.hpp.
References seed().
Definition at line 285 of file MersenneTwister.hpp.
References seed().
|
inline |
Definition at line 288 of file MersenneTwister.hpp.
References seed().
|
inline |
|
inlinestaticprotected |
Definition at line 159 of file MersenneTwister.hpp.
Definition at line 145 of file MersenneTwister.hpp.
Referenced by mixBits().
|
inlineprotected |
|
inline |
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().
|
inline |
Definition at line 376 of file MersenneTwister.hpp.
References rand().
|
inline |
|
inline |
Definition at line 336 of file MersenneTwister.hpp.
References randInt().
Referenced by operator()(), rand(), and randNorm().
|
inline |
Definition at line 339 of file MersenneTwister.hpp.
References rand().
|
inline |
Definition at line 354 of file MersenneTwister.hpp.
References randInt().
Referenced by vl::random().
|
inline |
Definition at line 348 of file MersenneTwister.hpp.
References randInt().
Referenced by randDblExc().
|
inline |
Definition at line 351 of file MersenneTwister.hpp.
References randDblExc().
|
inline |
|
inline |
Definition at line 345 of file MersenneTwister.hpp.
References randExc().
|
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().
|
inline |
Definition at line 317 of file MersenneTwister.hpp.
References randInt().
|
inline |
Definition at line 360 of file MersenneTwister.hpp.
References vl::log(), rand(), and vl::sqrt().
|
inlineprotected |
|
inline |
Definition at line 381 of file MersenneTwister.hpp.
|
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.
|
inline |
Definition at line 259 of file MersenneTwister.hpp.
References hash(), N, and NULL.
Referenced by MersenneTwister().
|
friend |
Definition at line 400 of file MersenneTwister.hpp.
|
friend |
Definition at line 408 of file MersenneTwister.hpp.
|
protected |
Definition at line 100 of file MersenneTwister.hpp.
Referenced by load(), MersenneTwister(), vl::operator<<(), operator=(), vl::operator>>(), randInt(), reload(), and save().
|
protected |
Definition at line 99 of file MersenneTwister.hpp.
Referenced by load(), MersenneTwister(), operator=(), vl::operator>>(), randInt(), and reload().
Definition at line 98 of file MersenneTwister.hpp.
Referenced by initialize(), load(), MersenneTwister(), vl::operator<<(), operator=(), vl::operator>>(), reload(), save(), and seed().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:52.
© Copyright Michele Bosi. All rights reserved.