QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Gaussian random number generator. More...
#include <boxmullergaussianrng.hpp>
Public Types | |
typedef Sample< Real > | sample_type |
typedef RNG | urng_type |
Public Member Functions | |
BoxMullerGaussianRng (const RNG &uniformGenerator) | |
sample_type | next () const |
returns a sample from a Gaussian distribution More... | |
Private Attributes | |
RNG | uniformGenerator_ |
bool | returnFirst_ = true |
Real | firstValue_ |
Real | secondValue_ |
Real | firstWeight_ |
Real | secondWeight_ |
Real | weight_ = 0.0 |
Gaussian random number generator.
It uses the well-known Box-Muller transformation to return a normal distributed Gaussian deviate with average 0.0 and standard deviation of 1.0, from a uniform deviate in (0,1) supplied by RNG.
Class RNG must implement the following interface:
Definition at line 44 of file boxmullergaussianrng.hpp.
typedef Sample<Real> sample_type |
Definition at line 46 of file boxmullergaussianrng.hpp.
typedef RNG urng_type |
Definition at line 47 of file boxmullergaussianrng.hpp.
|
explicit |
Definition at line 60 of file boxmullergaussianrng.hpp.
BoxMullerGaussianRng< RNG >::sample_type next |
returns a sample from a Gaussian distribution
Definition at line 65 of file boxmullergaussianrng.hpp.
|
private |
Definition at line 52 of file boxmullergaussianrng.hpp.
|
mutableprivate |
Definition at line 53 of file boxmullergaussianrng.hpp.
|
mutableprivate |
Definition at line 54 of file boxmullergaussianrng.hpp.
|
private |
Definition at line 54 of file boxmullergaussianrng.hpp.
|
mutableprivate |
Definition at line 55 of file boxmullergaussianrng.hpp.
|
private |
Definition at line 55 of file boxmullergaussianrng.hpp.
|
mutableprivate |
Definition at line 56 of file boxmullergaussianrng.hpp.