|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
Uniform random number generator. More...
#include <mt19937uniformrng.hpp>
Collaboration diagram for MersenneTwisterUniformRng:Public Types | |
| typedef Sample< Real > | sample_type |
Public Member Functions | |
| MersenneTwisterUniformRng (unsigned long seed=0) | |
| MersenneTwisterUniformRng (const std::vector< unsigned long > &seeds) | |
| sample_type | next () const |
| Real | nextReal () const |
| return a random number in the (0.0, 1.0)-interval More... | |
| unsigned long | nextInt32 () const |
| return a random integer in the [0,0xffffffff]-interval More... | |
Private Member Functions | |
| void | seedInitialization (unsigned long seed) |
| void | twist () const |
Private Attributes | |
| unsigned long | mt [N] |
| Size | mti |
Static Private Attributes | |
| static const Size | N = 624 |
| static const Size | M = 397 |
| static const unsigned long | MATRIX_A = 0x9908b0dfUL |
| static const unsigned long | UPPER_MASK =0x80000000UL |
| static const unsigned long | LOWER_MASK =0x7fffffffUL |
Uniform random number generator.
Mersenne Twister random number generator of period 2**19937-1
For more details see http://www.math.keio.ac.jp/matumoto/emt.html
Definition at line 41 of file mt19937uniformrng.hpp.
| typedef Sample<Real> sample_type |
Definition at line 46 of file mt19937uniformrng.hpp.
|
explicit |
if the given seed is 0, a random seed will be chosen based on clock()
Definition at line 82 of file mt19937uniformrng.cpp.
Here is the call graph for this function:
|
explicit |
| sample_type next | ( | ) | const |
returns a sample with weight 1.0 containing a random number in the (0.0, 1.0) interval
Definition at line 54 of file mt19937uniformrng.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Real nextReal | ( | ) | const |
return a random number in the (0.0, 1.0)-interval
Definition at line 56 of file mt19937uniformrng.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned long nextInt32 | ( | ) | const |
return a random integer in the [0,0xffffffff]-interval
Definition at line 60 of file mt19937uniformrng.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 86 of file mt19937uniformrng.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
staticprivate |
Definition at line 43 of file mt19937uniformrng.hpp.
|
staticprivate |
Definition at line 44 of file mt19937uniformrng.hpp.
|
mutableprivate |
Definition at line 76 of file mt19937uniformrng.hpp.
|
mutableprivate |
Definition at line 77 of file mt19937uniformrng.hpp.
|
staticprivate |
Definition at line 78 of file mt19937uniformrng.hpp.
|
staticprivate |
Definition at line 78 of file mt19937uniformrng.hpp.
|
staticprivate |
Definition at line 78 of file mt19937uniformrng.hpp.