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
InverseCumulativeRng< RNG, IC > Class Template Reference

Inverse cumulative random number generator. More...

#include <inversecumulativerng.hpp>

+ Collaboration diagram for InverseCumulativeRng< RNG, IC >:

Public Types

typedef Sample< Realsample_type
 
typedef RNG urng_type
 

Public Member Functions

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

Private Attributes

RNG uniformGenerator_
 
IC ICND_
 

Detailed Description

template<class RNG, class IC>
class QuantLib::InverseCumulativeRng< RNG, IC >

Inverse cumulative random number generator.

It uses a uniform deviate in (0, 1) as the source of cumulative distribution values. Then an inverse cumulative distribution is used to calculate the distribution deviate.

The uniform deviate is supplied by RNG.

Class RNG must implement the following interface:

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

The inverse cumulative distribution is supplied by IC.

Class IC must implement the following interface:

IC::IC();
Real IC::operator() const;
QL_REAL Real
real number
Definition: types.hpp:50

Definition at line 54 of file inversecumulativerng.hpp.

Member Typedef Documentation

◆ sample_type

Definition at line 56 of file inversecumulativerng.hpp.

◆ urng_type

typedef RNG urng_type

Definition at line 57 of file inversecumulativerng.hpp.

Constructor & Destructor Documentation

◆ InverseCumulativeRng()

InverseCumulativeRng ( const RNG &  uniformGenerator)
explicit

Definition at line 67 of file inversecumulativerng.hpp.

Member Function Documentation

◆ next()

returns a sample from a Gaussian distribution

Definition at line 72 of file inversecumulativerng.hpp.

Member Data Documentation

◆ uniformGenerator_

RNG uniformGenerator_
private

Definition at line 62 of file inversecumulativerng.hpp.

◆ ICND_

IC ICND_
private

Definition at line 63 of file inversecumulativerng.hpp.