QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DiscretizedOption Class Reference

Discretized option on a given asset. More...

#include <ql/discretizedasset.hpp>

+ Inheritance diagram for DiscretizedOption:

Public Member Functions

 DiscretizedOption (const ext::shared_ptr< DiscretizedAsset > &underlying, Exercise::Type exerciseType, const std::vector< Time > &exerciseTimes)
 
void reset (Size size)
 
std::vector< TimemandatoryTimes () const
 
- Public Member Functions inherited from DiscretizedAsset
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 ()
 
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_
 

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.

Member Function Documentation

◆ reset()

void reset ( Size  size)
virtual

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

Implements DiscretizedAsset.

◆ mandatoryTimes()

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

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.

◆ postAdjustValuesImpl()

void postAdjustValuesImpl ( )
protectedvirtual

This method performs the actual post-adjustment

Reimplemented from DiscretizedAsset.