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

Discretized option on a given asset. More...

#include <discretizedasset.hpp>

+ Inheritance diagram for DiscretizedOption:
+ Collaboration diagram for DiscretizedOption:

Public Member Functions

 DiscretizedOption (ext::shared_ptr< DiscretizedAsset > underlying, Exercise::Type exerciseType, std::vector< Time > exerciseTimes)
 
void reset (Size size) override
 
std::vector< TimemandatoryTimes () const override
 
- Public Member Functions inherited from DiscretizedAsset
 DiscretizedAsset ()
 
virtual ~DiscretizedAsset ()=default
 
Time time () const
 
Timetime ()
 
const Arrayvalues () const
 
Arrayvalues ()
 
const ext::shared_ptr< Lattice > & method () const
 
void initialize (const ext::shared_ptr< Lattice > &, Time t)
 
void rollback (Time to)
 
void partialRollback (Time to)
 
Real presentValue ()
 
void preAdjustValues ()
 
void postAdjustValues ()
 
void adjustValues ()
 

Protected Member Functions

void postAdjustValuesImpl () override
 
void applyExerciseCondition ()
 
- Protected Member Functions inherited from DiscretizedAsset
bool isOnTime (Time t) const
 
virtual void preAdjustValuesImpl ()
 

Protected Attributes

ext::shared_ptr< DiscretizedAssetunderlying_
 
Exercise::Type exerciseType_
 
std::vector< TimeexerciseTimes_
 
- Protected Attributes inherited from DiscretizedAsset
Time time_
 
Time latestPreAdjustment_
 
Time latestPostAdjustment_
 
Array values_
 

Additional Inherited Members

- Protected Types inherited from DiscretizedAsset
enum class  CouponAdjustment { pre , post }
 

Detailed Description

Discretized option on a given asset.

Warning:
it is advised that derived classes take care of creating and initializing themselves an instance of the underlying.

Definition at line 160 of file discretizedasset.hpp.

Constructor & Destructor Documentation

◆ DiscretizedOption()

DiscretizedOption ( ext::shared_ptr< DiscretizedAsset underlying,
Exercise::Type  exerciseType,
std::vector< Time exerciseTimes 
)

Definition at line 162 of file discretizedasset.hpp.

Member Function Documentation

◆ reset()

void reset ( Size  size)
overridevirtual

This method should initialize the asset values to an Array of the given size and with values depending on the particular asset.

Implements DiscretizedAsset.

Reimplemented in DiscretizedSwaption.

Definition at line 221 of file discretizedasset.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mandatoryTimes()

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

This method returns the times at which the numerical method should stop while rolling back the asset. Typical examples include payment times, exercise times and such.

Note
The returned values are not guaranteed to be sorted.

Implements DiscretizedAsset.

Definition at line 229 of file discretizedasset.hpp.

+ Here is the caller graph for this function:

◆ postAdjustValuesImpl()

void postAdjustValuesImpl ( )
overrideprotectedvirtual

This method performs the actual post-adjustment

Reimplemented from DiscretizedAsset.

Definition at line 25 of file discretizedasset.cpp.

+ Here is the call graph for this function:

◆ applyExerciseCondition()

void applyExerciseCondition ( )
protected

Definition at line 239 of file discretizedasset.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ underlying_

ext::shared_ptr<DiscretizedAsset> underlying_
protected

Definition at line 173 of file discretizedasset.hpp.

◆ exerciseType_

Exercise::Type exerciseType_
protected

Definition at line 174 of file discretizedasset.hpp.

◆ exerciseTimes_

std::vector<Time> exerciseTimes_
protected

Definition at line 175 of file discretizedasset.hpp.