QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
List of all members
MultiProductComposite Class Reference

Composition of one or more market-model products. More...

#include <ql/models/marketmodels/products/multiproductcomposite.hpp>

+ Inheritance diagram for MultiProductComposite:
+ Collaboration diagram for MultiProductComposite:

Public Member Functions

MarketModelMultiProduct interface
Size numberOfProducts () const override
 
Size maxNumberOfCashFlowsPerProductPerStep () const override
 
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...
 
- Public Member Functions inherited from MarketModelComposite
 MarketModelComposite ()=default
 
const EvolutionDescriptionevolution () const override
 
std::vector< SizesuggestedNumeraires () const override
 
std::vector< TimepossibleCashFlowTimes () const override
 
void reset () override
 during simulation put product at start of path More...
 
void add (const Clone< MarketModelMultiProduct > &, Real multiplier=1.0)
 
void subtract (const Clone< MarketModelMultiProduct > &, Real multiplier=1.0)
 
void finalize ()
 
Size size () const
 
const MarketModelMultiProductitem (Size i) const
 
MarketModelMultiProductitem (Size i)
 
Real multiplier (Size i) const
 
- 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...
 

Additional Inherited Members

- Protected Types inherited from MarketModelComposite
typedef std::vector< SubProduct >::iterator iterator
 
typedef std::vector< SubProduct >::const_iterator const_iterator
 
- Protected Attributes inherited from MarketModelComposite
std::vector< SubProductcomponents_
 
std::vector< TimerateTimes_
 
std::vector< TimeevolutionTimes_
 
EvolutionDescription evolution_
 
bool finalized_ = false
 
Size currentIndex_
 
std::vector< TimecashflowTimes_
 
std::vector< std::vector< Time > > allEvolutionTimes_
 
std::vector< std::valarray< bool > > isInSubset_
 

Detailed Description

Composition of one or more market-model products.

Instances of this class build a multiple market-model product by composing two or more subproducts.

Precondition
All subproducts must have the same rate times.
Examples
MarketModels.cpp.

Definition at line 33 of file multiproductcomposite.hpp.

Member Function Documentation

◆ numberOfProducts()

Size numberOfProducts ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 24 of file multiproductcomposite.cpp.

+ Here is the caller graph for this function:

◆ maxNumberOfCashFlowsPerProductPerStep()

Size maxNumberOfCashFlowsPerProductPerStep ( ) const
overridevirtual

Implements MarketModelMultiProduct.

Definition at line 32 of file multiproductcomposite.cpp.

+ Here is the caller graph for this function:

◆ 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 40 of file multiproductcomposite.cpp.

+ Here is the caller graph for this function:

◆ clone()

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

returns a newly-allocated copy of itself

Implements MarketModelMultiProduct.

Definition at line 82 of file multiproductcomposite.cpp.