QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
RandomSequenceGenerator< RNG > Class Template Reference

Random sequence generator based on a pseudo-random number generator. More...

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

Public Types

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

Public Member Functions

 RandomSequenceGenerator (Size dimensionality, const RNG &rng)
 RandomSequenceGenerator (Size dimensionality, BigNatural seed=0)
const sample_typenextSequence () const
std::vector< BigNaturalnextInt32Sequence () const
const sample_typelastSequence () const
Size dimension () const

Detailed Description

template<class RNG>
class QuantLib::RandomSequenceGenerator< RNG >

Random sequence generator based on a pseudo-random number generator.

Random sequence generator based on a pseudo-random number generator RNG.

Class RNG must implement the following interface:

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

If a client of this class wants to use the nextInt32Sequence method, class RNG must also implement

unsigned long RNG::nextInt32() const;
Warning
do not use with low-discrepancy sequence generator.
Examples
BasketLosses.cpp.