QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Uniform random number generator. More...
#include <lecuyeruniformrng.hpp>
Public Types | |
typedef Sample< Real > | sample_type |
Public Member Functions | |
LecuyerUniformRng (long seed=0) | |
sample_type | next () const |
Private Attributes | |
long | temp1 |
long | temp2 |
long | y |
std::vector< long > | buffer |
Static Private Attributes | |
static const long | m1 = 2147483563L |
static const long | a1 = 40014L |
static const long | q1 = 53668L |
static const long | r1 = 12211L |
static const long | m2 = 2147483399L |
static const long | a2 = 40692L |
static const long | q2 = 52774L |
static const long | r2 = 3791L |
static const int | bufferSize = 32 |
static const long | bufferNormalizer = 67108862L |
static const long double | maxRandom = 1.0-QL_EPSILON |
Uniform random number generator.
Random number generator of L'Ecuyer with added Bays-Durham shuffle (know as ran2 in Numerical recipes)
For more details see Section 7.1 of Numerical Recipes in C, 2nd Edition, Cambridge University Press (available at http://www.nr.com/)
Definition at line 40 of file lecuyeruniformrng.hpp.
typedef Sample<Real> sample_type |
Definition at line 42 of file lecuyeruniformrng.hpp.
|
explicit |
if the given seed is 0, a random seed will be chosen based on clock()
Definition at line 42 of file lecuyeruniformrng.cpp.
LecuyerUniformRng::sample_type next | ( | ) | const |
returns a sample with weight 1.0 containing a random number uniformly chosen from (0.0,1.0)
Definition at line 58 of file lecuyeruniformrng.cpp.
|
mutableprivate |
Definition at line 50 of file lecuyeruniformrng.hpp.
|
private |
Definition at line 50 of file lecuyeruniformrng.hpp.
|
mutableprivate |
Definition at line 51 of file lecuyeruniformrng.hpp.
|
mutableprivate |
Definition at line 52 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 53 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 54 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 55 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 56 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 57 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 58 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 59 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 60 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 61 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 62 of file lecuyeruniformrng.hpp.
|
staticprivate |
Definition at line 63 of file lecuyeruniformrng.hpp.