QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
HaltonRsg Class Reference

Halton low-discrepancy sequence generator. More...

#include <ql/math/randomnumbers/haltonrsg.hpp>

+ Collaboration diagram for HaltonRsg:

Public Types

typedef Sample< std::vector< Real > > sample_type
 

Public Member Functions

 HaltonRsg (Size dimensionality, unsigned long seed=0, bool randomStart=true, bool randomShift=false)
 
const sample_typenextSequence () const
 
const sample_typelastSequence () const
 
Size dimension () const
 

Private Attributes

Size dimensionality_
 
unsigned long sequenceCounter_ = 0
 
sample_type sequence_
 
std::vector< unsigned long > randomStart_
 
std::vector< RealrandomShift_
 

Detailed Description

Halton low-discrepancy sequence generator.

Halton algorithm for low-discrepancy sequence. For more details see chapter 8, paragraph 2 of "Monte Carlo Methods in Finance", by Peter Jäckel

Tests:
  • the correctness of the returned values is tested by reproducing known good values.
  • the correctness of the returned values is tested by checking their discrepancy against known good values.

Definition at line 43 of file haltonrsg.hpp.

Member Typedef Documentation

◆ sample_type

typedef Sample<std::vector<Real> > sample_type

Definition at line 45 of file haltonrsg.hpp.

Constructor & Destructor Documentation

◆ HaltonRsg()

HaltonRsg ( Size  dimensionality,
unsigned long  seed = 0,
bool  randomStart = true,
bool  randomShift = false 
)
explicit

Definition at line 36 of file haltonrsg.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ nextSequence()

const HaltonRsg::sample_type & nextSequence ( ) const

Definition at line 56 of file haltonrsg.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lastSequence()

const sample_type & lastSequence ( ) const

Definition at line 51 of file haltonrsg.hpp.

◆ dimension()

Size dimension ( ) const

Definition at line 54 of file haltonrsg.hpp.

Member Data Documentation

◆ dimensionality_

Size dimensionality_
private

Definition at line 56 of file haltonrsg.hpp.

◆ sequenceCounter_

unsigned long sequenceCounter_ = 0
mutableprivate

Definition at line 57 of file haltonrsg.hpp.

◆ sequence_

sample_type sequence_
mutableprivate

Definition at line 58 of file haltonrsg.hpp.

◆ randomStart_

std::vector<unsigned long> randomStart_
private

Definition at line 59 of file haltonrsg.hpp.

◆ randomShift_

std::vector<Real> randomShift_
private

Definition at line 60 of file haltonrsg.hpp.