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
LongstaffSchwartzExerciseStrategy Class Reference

#include <lsstrategy.hpp>

+ Inheritance diagram for LongstaffSchwartzExerciseStrategy:
+ Collaboration diagram for LongstaffSchwartzExerciseStrategy:

Public Member Functions

 LongstaffSchwartzExerciseStrategy (Clone< MarketModelBasisSystem > basisSystem, std::vector< std::vector< Real > > basisCoefficients, const EvolutionDescription &evolution, const std::vector< Size > &numeraires, Clone< MarketModelExerciseValue > exercise, Clone< MarketModelExerciseValue > control)
 
std::vector< TimeexerciseTimes () const override
 
std::vector< TimerelevantTimes () const override
 
void reset () override
 
bool exercise (const CurveState &currentState) const override
 
void nextStep (const CurveState &currentState) override
 
std::unique_ptr< ExerciseStrategy< CurveState > > clone () const override
 
- Public Member Functions inherited from ExerciseStrategy< CurveState >
virtual ~ExerciseStrategy ()=default
 
virtual std::vector< TimeexerciseTimes () const=0
 
virtual std::vector< TimerelevantTimes () const=0
 
virtual void reset ()=0
 
virtual bool exercise (const CurveState &currentState) const=0
 
virtual void nextStep (const CurveState &currentState)=0
 
virtual std::unique_ptr< ExerciseStrategy< CurveState > > clone () const=0
 

Private Attributes

Clone< MarketModelBasisSystembasisSystem_
 
std::vector< std::vector< Real > > basisCoefficients_
 
Clone< MarketModelExerciseValueexercise_
 
Clone< MarketModelExerciseValuecontrol_
 
std::vector< Sizenumeraires_
 
Size currentIndex_
 
Real principalInNumerairePortfolio_
 
Real newPrincipal_
 
std::vector< TimeexerciseTimes_
 
std::vector< TimerelevantTimes_
 
std::valarray< boolisBasisTime_
 
std::valarray< boolisRebateTime_
 
std::valarray< boolisControlTime_
 
std::valarray< boolisExerciseTime_
 
std::vector< MarketModelDiscounterrebateDiscounters_
 
std::vector< MarketModelDiscountercontrolDiscounters_
 
std::vector< std::vector< Real > > basisValues_
 
std::vector< SizeexerciseIndex_
 

Detailed Description

Examples
MarketModels.cpp.

Definition at line 32 of file lsstrategy.hpp.

Constructor & Destructor Documentation

◆ LongstaffSchwartzExerciseStrategy()

LongstaffSchwartzExerciseStrategy ( Clone< MarketModelBasisSystem basisSystem,
std::vector< std::vector< Real > >  basisCoefficients,
const EvolutionDescription evolution,
const std::vector< Size > &  numeraires,
Clone< MarketModelExerciseValue exercise,
Clone< MarketModelExerciseValue control 
)

Definition at line 31 of file lsstrategy.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ exerciseTimes()

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

Implements ExerciseStrategy< CurveState >.

Definition at line 88 of file lsstrategy.cpp.

◆ relevantTimes()

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

Implements ExerciseStrategy< CurveState >.

Definition at line 93 of file lsstrategy.cpp.

◆ reset()

void reset ( )
overridevirtual

Implements ExerciseStrategy< CurveState >.

Definition at line 97 of file lsstrategy.cpp.

◆ exercise()

bool exercise ( const CurveState currentState) const
overridevirtual

Implements ExerciseStrategy< CurveState >.

Definition at line 105 of file lsstrategy.cpp.

+ Here is the call graph for this function:

◆ nextStep()

void nextStep ( const CurveState currentState)
overridevirtual

Implements ExerciseStrategy< CurveState >.

Definition at line 136 of file lsstrategy.cpp.

+ Here is the call graph for this function:

◆ clone()

std::unique_ptr< ExerciseStrategy< CurveState > > clone ( ) const
overridevirtual

Implements ExerciseStrategy< CurveState >.

Definition at line 158 of file lsstrategy.cpp.

Member Data Documentation

◆ basisSystem_

Clone<MarketModelBasisSystem> basisSystem_
private

Definition at line 48 of file lsstrategy.hpp.

◆ basisCoefficients_

std::vector<std::vector<Real> > basisCoefficients_
private

Definition at line 49 of file lsstrategy.hpp.

◆ exercise_

Clone<MarketModelExerciseValue> exercise_
private

Definition at line 50 of file lsstrategy.hpp.

◆ control_

Clone<MarketModelExerciseValue> control_
private

Definition at line 51 of file lsstrategy.hpp.

◆ numeraires_

std::vector<Size> numeraires_
private

Definition at line 52 of file lsstrategy.hpp.

◆ currentIndex_

Size currentIndex_
private

Definition at line 54 of file lsstrategy.hpp.

◆ principalInNumerairePortfolio_

Real principalInNumerairePortfolio_
private

Definition at line 55 of file lsstrategy.hpp.

◆ newPrincipal_

Real newPrincipal_
private

Definition at line 55 of file lsstrategy.hpp.

◆ exerciseTimes_

std::vector<Time> exerciseTimes_
private

Definition at line 56 of file lsstrategy.hpp.

◆ relevantTimes_

std::vector<Time> relevantTimes_
private

Definition at line 56 of file lsstrategy.hpp.

◆ isBasisTime_

std::valarray<bool> isBasisTime_
private

Definition at line 57 of file lsstrategy.hpp.

◆ isRebateTime_

std::valarray<bool> isRebateTime_
private

Definition at line 57 of file lsstrategy.hpp.

◆ isControlTime_

std::valarray<bool> isControlTime_
private

Definition at line 57 of file lsstrategy.hpp.

◆ isExerciseTime_

std::valarray<bool> isExerciseTime_
private

Definition at line 58 of file lsstrategy.hpp.

◆ rebateDiscounters_

std::vector<MarketModelDiscounter> rebateDiscounters_
private

Definition at line 59 of file lsstrategy.hpp.

◆ controlDiscounters_

std::vector<MarketModelDiscounter> controlDiscounters_
private

Definition at line 60 of file lsstrategy.hpp.

◆ basisValues_

std::vector<std::vector<Real> > basisValues_
mutableprivate

Definition at line 61 of file lsstrategy.hpp.

◆ exerciseIndex_

std::vector<Size> exerciseIndex_
private

Definition at line 62 of file lsstrategy.hpp.