Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MultiPathGeneratorSobol Class Reference

Instantiation of MultiPathGenerator with standard LowDiscrepancy traits. More...

#include <qle/methods/multipathgeneratorbase.hpp>

+ Inheritance diagram for MultiPathGeneratorSobol:
+ Collaboration diagram for MultiPathGeneratorSobol:

Public Member Functions

 MultiPathGeneratorSobol (const QuantLib::ext::shared_ptr< StochasticProcess > &, const TimeGrid &, BigNatural seed=0, SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7)
 
const Sample< MultiPath > & next () const override
 
void reset () override
 
- Public Member Functions inherited from MultiPathGeneratorBase
virtual ~MultiPathGeneratorBase ()
 
virtual const Sample< MultiPath > & next () const =0
 
virtual void reset ()=0
 

Private Attributes

const QuantLib::ext::shared_ptr< StochasticProcessprocess_
 
TimeGrid grid_
 
BigNatural seed_
 
SobolRsg::DirectionIntegers directionIntegers_
 
QuantLib::ext::shared_ptr< MultiPathGenerator< LowDiscrepancy::rsg_type > > pg_
 
QuantLib::ext::shared_ptr< PathGenerator< LowDiscrepancy::rsg_type > > pg1D_
 
Sample< MultiPath > next_
 

Detailed Description

Instantiation of MultiPathGenerator with standard LowDiscrepancy traits.

no Brownian bridge provided, use MultiPathGeneratorSobolBrownianBridge for this, for the use of the seed, see ql/math/randomnumbers/sobolrsg.cpp

\ingroup methods

Definition at line 91 of file multipathgeneratorbase.hpp.

Constructor & Destructor Documentation

◆ MultiPathGeneratorSobol()

MultiPathGeneratorSobol ( const QuantLib::ext::shared_ptr< StochasticProcess > &  process,
const TimeGrid &  grid,
BigNatural  seed = 0,
SobolRsg::DirectionIntegers  directionIntegers = SobolRsg::JoeKuoD7 
)

Definition at line 63 of file multipathgeneratorbase.cpp.

66 : process_(process), grid_(grid), seed_(seed), directionIntegers_(directionIntegers),
67 next_(MultiPath(process->size(), grid), 1.0) {
69}
const QuantLib::ext::shared_ptr< StochasticProcess > process_
SobolRsg::DirectionIntegers directionIntegers_
+ Here is the call graph for this function:

Member Function Documentation

◆ next()

const Sample< MultiPath > & next ( ) const
overridevirtual

Implements MultiPathGeneratorBase.

Definition at line 87 of file multipathgeneratorbase.cpp.

87 {
88 if (pg_)
89 return pg_->next();
90 else {
91 next_.value.at(0) = pg1D_->next().value;
92 return next_;
93 }
94}
QuantLib::ext::shared_ptr< MultiPathGenerator< LowDiscrepancy::rsg_type > > pg_
QuantLib::ext::shared_ptr< PathGenerator< LowDiscrepancy::rsg_type > > pg1D_

◆ reset()

void reset ( )
overridevirtual

Implements MultiPathGeneratorBase.

Definition at line 71 of file multipathgeneratorbase.cpp.

71 {
72 if (auto tmp = QuantLib::ext::dynamic_pointer_cast<StochasticProcess1D>(process_)) {
73 pg1D_ = QuantLib::ext::make_shared<PathGenerator<InverseCumulativeRsg<SobolRsg, InverseCumulativeNormal>>>(
74 tmp, grid_,
75 InverseCumulativeRsg<SobolRsg, InverseCumulativeNormal>(
76 SobolRsg(process_->factors() * (grid_.size() - 1), seed_, directionIntegers_)),
77 false);
78
79 } else {
80 pg_ = QuantLib::ext::make_shared<MultiPathGenerator<InverseCumulativeRsg<SobolRsg, InverseCumulativeNormal>>>(
82 InverseCumulativeRsg<SobolRsg, InverseCumulativeNormal>(
83 SobolRsg(process_->factors() * (grid_.size() - 1), seed_, directionIntegers_)));
84 }
85}
+ Here is the caller graph for this function:

Member Data Documentation

◆ process_

const QuantLib::ext::shared_ptr<StochasticProcess> process_
private

Definition at line 99 of file multipathgeneratorbase.hpp.

◆ grid_

TimeGrid grid_
private

Definition at line 100 of file multipathgeneratorbase.hpp.

◆ seed_

BigNatural seed_
private

Definition at line 101 of file multipathgeneratorbase.hpp.

◆ directionIntegers_

SobolRsg::DirectionIntegers directionIntegers_
private

Definition at line 102 of file multipathgeneratorbase.hpp.

◆ pg_

QuantLib::ext::shared_ptr<MultiPathGenerator<LowDiscrepancy::rsg_type> > pg_
private

Definition at line 104 of file multipathgeneratorbase.hpp.

◆ pg1D_

QuantLib::ext::shared_ptr<PathGenerator<LowDiscrepancy::rsg_type> > pg1D_
private

Definition at line 105 of file multipathgeneratorbase.hpp.

◆ next_

Sample<MultiPath> next_
mutableprivate

Definition at line 106 of file multipathgeneratorbase.hpp.