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

#include <multisteppathwisewrapper.hpp>

+ Inheritance diagram for MultiProductPathwiseWrapper:
+ Collaboration diagram for MultiProductPathwiseWrapper:

Public Member Functions

 MultiProductPathwiseWrapper (const MarketModelPathwiseMultiProduct &innerProduct_)
 
std::vector< TimepossibleCashFlowTimes () const override
 
Size numberOfProducts () const override
 
Size maxNumberOfCashFlowsPerProductPerStep () const override
 
void reset () override
 during simulation put product at start of path More...
 
bool nextTimeStep (const CurveState &currentState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< CashFlow > > &cashFlowsGenerated) 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...
 
std::vector< SizesuggestedNumeraires () const override
 
const EvolutionDescriptionevolution () 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...
 

Private Attributes

Clone< MarketModelPathwiseMultiProductinnerProduct_
 
std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > cashFlowsGenerated_
 
Size numberOfProducts_
 

Detailed Description

MultiStepPathwiseWrapper Pathwise products do everything that ordinary products do and more. This lets you treat a pathwise product as an ordinary product. So you only have to write the product once.

Tested in MarketModels::testInverseFloater()

Definition at line 39 of file multisteppathwisewrapper.hpp.

Constructor & Destructor Documentation

◆ MultiProductPathwiseWrapper()

Definition at line 27 of file multisteppathwisewrapper.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ possibleCashFlowTimes()

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

Implements MarketModelMultiProduct.

Definition at line 37 of file multisteppathwisewrapper.cpp.

◆ numberOfProducts()

Size numberOfProducts ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 42 of file multisteppathwisewrapper.cpp.

◆ maxNumberOfCashFlowsPerProductPerStep()

Size maxNumberOfCashFlowsPerProductPerStep ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 47 of file multisteppathwisewrapper.cpp.

◆ reset()

void reset ( )
overridevirtual

during simulation put product at start of path

Implements MarketModelMultiProduct.

Definition at line 52 of file multisteppathwisewrapper.cpp.

◆ 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 57 of file multisteppathwisewrapper.cpp.

◆ clone()

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

returns a newly-allocated copy of itself

Implements MarketModelMultiProduct.

Definition at line 87 of file multisteppathwisewrapper.cpp.

◆ suggestedNumeraires()

std::vector< Size > suggestedNumeraires ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 76 of file multisteppathwisewrapper.cpp.

◆ evolution()

const EvolutionDescription & evolution ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 81 of file multisteppathwisewrapper.cpp.

Member Data Documentation

◆ innerProduct_

Clone<MarketModelPathwiseMultiProduct> innerProduct_
private

Definition at line 55 of file multisteppathwisewrapper.hpp.

◆ cashFlowsGenerated_

std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> > cashFlowsGenerated_
private

Definition at line 56 of file multisteppathwisewrapper.hpp.

◆ numberOfProducts_

Size numberOfProducts_
private

Definition at line 57 of file multisteppathwisewrapper.hpp.