QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
CLGaussianRng< RNG > Class Template Reference

Gaussian random number generator. More...

#include <centrallimitgaussianrng.hpp>

+ Collaboration diagram for CLGaussianRng< RNG >:

Public Types

typedef Sample< Realsample_type
 
typedef RNG urng_type
 

Public Member Functions

 CLGaussianRng (const RNG &uniformGenerator)
 
sample_type next () const
 returns a sample from a Gaussian distribution More...
 

Private Attributes

RNG uniformGenerator_
 

Detailed Description

template<class RNG>
class QuantLib::CLGaussianRng< RNG >

Gaussian random number generator.

It uses the well-known fact that the sum of 12 uniform deviate in (-.5,.5) is approximately a Gaussian deviate with average 0 and standard deviation 1. The uniform deviate is supplied by RNG.

Class RNG must implement the following interface:

RNG::sample_type RNG::next() const;

Definition at line 44 of file centrallimitgaussianrng.hpp.

Member Typedef Documentation

◆ sample_type

Definition at line 46 of file centrallimitgaussianrng.hpp.

◆ urng_type

typedef RNG urng_type

Definition at line 47 of file centrallimitgaussianrng.hpp.

Constructor & Destructor Documentation

◆ CLGaussianRng()

CLGaussianRng ( const RNG &  uniformGenerator)
explicit

Definition at line 56 of file centrallimitgaussianrng.hpp.

Member Function Documentation

◆ next()

returns a sample from a Gaussian distribution

Definition at line 61 of file centrallimitgaussianrng.hpp.

Member Data Documentation

◆ uniformGenerator_

RNG uniformGenerator_
private

Definition at line 52 of file centrallimitgaussianrng.hpp.