QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ExerciseAdapter Class Reference

#include <exerciseadapter.hpp>

+ Inheritance diagram for ExerciseAdapter:
+ Collaboration diagram for ExerciseAdapter:

Public Member Functions

 ExerciseAdapter (const Clone< MarketModelExerciseValue > &exercise, Size numberOfProducts=1)
 
MarketModelMultiProduct interface
std::vector< TimepossibleCashFlowTimes () const override
 
Size numberOfProducts () const override
 
const EvolutionDescriptionevolution () const override
 
Size maxNumberOfCashFlowsPerProductPerStep () const override
 
void reset () override
 during simulation put product at start of path More...
 
bool nextTimeStep (const CurveState &, std::vector< Size > &, std::vector< std::vector< CashFlow > > &) override
 return value indicates whether path is finished, TRUE means done More...
 
std::unique_ptr< MarketModelMultiProductclone () const override
 returns a newly-allocated copy of itself More...
 
- Public Member Functions inherited from MultiProductMultiStep
 MultiProductMultiStep (std::vector< Time > rateTimes)
 
std::vector< SizesuggestedNumeraires () const override
 
- Public Member Functions inherited from MarketModelMultiProduct
virtual ~MarketModelMultiProduct ()=default
 
virtual std::vector< SizesuggestedNumeraires () const =0
 
virtual const EvolutionDescriptionevolution () const =0
 
virtual std::vector< TimepossibleCashFlowTimes () const =0
 
virtual Size numberOfProducts () const =0
 
virtual Size maxNumberOfCashFlowsPerProductPerStep () const =0
 
virtual void reset ()=0
 during simulation put product at start of path More...
 
virtual bool nextTimeStep (const CurveState &currentState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< CashFlow > > &cashFlowsGenerated)=0
 return value indicates whether path is finished, TRUE means done More...
 
virtual std::unique_ptr< MarketModelMultiProductclone () const =0
 returns a newly-allocated copy of itself More...
 

inspectors

Clone< MarketModelExerciseValueexercise_
 
Size numberOfProducts_
 
std::valarray< boolisExerciseTime_
 
Size currentIndex_
 
const MarketModelExerciseValueexerciseValue () const
 

Additional Inherited Members

- Protected Attributes inherited from MultiProductMultiStep
std::vector< TimerateTimes_
 
EvolutionDescription evolution_
 

Detailed Description

Examples
MarketModels.cpp.

Definition at line 30 of file exerciseadapter.hpp.

Constructor & Destructor Documentation

◆ ExerciseAdapter()

ExerciseAdapter ( const Clone< MarketModelExerciseValue > &  exercise,
Size  numberOfProducts = 1 
)

Definition at line 24 of file exerciseadapter.cpp.

Member Function Documentation

◆ possibleCashFlowTimes()

std::vector< Time > possibleCashFlowTimes ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 60 of file exerciseadapter.hpp.

◆ numberOfProducts()

Size numberOfProducts ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 64 of file exerciseadapter.hpp.

◆ evolution()

const EvolutionDescription & evolution ( ) const
overridevirtual

Reimplemented from MultiProductMultiStep.

Definition at line 68 of file exerciseadapter.hpp.

◆ maxNumberOfCashFlowsPerProductPerStep()

Size maxNumberOfCashFlowsPerProductPerStep ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 73 of file exerciseadapter.hpp.

◆ reset()

void reset ( )
overridevirtual

during simulation put product at start of path

Implements MarketModelMultiProduct.

Definition at line 77 of file exerciseadapter.hpp.

◆ nextTimeStep()

bool nextTimeStep ( const CurveState currentState,
std::vector< Size > &  numberCashFlowsThisStep,
std::vector< std::vector< CashFlow > > &  cashFlowsGenerated 
)
overridevirtual

return value indicates whether path is finished, TRUE means done

Implements MarketModelMultiProduct.

Definition at line 31 of file exerciseadapter.cpp.

◆ clone()

std::unique_ptr< MarketModelMultiProduct > clone ( ) const
overridevirtual

returns a newly-allocated copy of itself

Implements MarketModelMultiProduct.

Definition at line 53 of file exerciseadapter.cpp.

◆ exerciseValue()

const MarketModelExerciseValue & exerciseValue ( ) const

Definition at line 83 of file exerciseadapter.hpp.

Member Data Documentation

◆ exercise_

Clone<MarketModelExerciseValue> exercise_
private

Definition at line 51 of file exerciseadapter.hpp.

◆ numberOfProducts_

Size numberOfProducts_
private

Definition at line 52 of file exerciseadapter.hpp.

◆ isExerciseTime_

std::valarray<bool> isExerciseTime_
private

Definition at line 53 of file exerciseadapter.hpp.

◆ currentIndex_

Size currentIndex_
private

Definition at line 54 of file exerciseadapter.hpp.