QuantLib_DiscretizedAsset man page

DiscretizedAsset — Discretized asset class used by numerical methods.

Synopsis

#include <ql/discretizedasset.hpp>

Inherited by DiscretizedBarrierOption, DiscretizedCallableFixedRateBond, DiscretizedCapFloor, DiscretizedConvertible, DiscretizedDermanKaniBarrierOption, DiscretizedDermanKaniDoubleBarrierOption, DiscretizedDiscountBond, DiscretizedDoubleBarrierOption, DiscretizedOption, DiscretizedSwap, and DiscretizedVanillaOption.

Public Member Functions

inspectors

Time time () const

Time & time ()

const Array & values () const

Array & values ()

const boost::shared_ptr< Lattice > & method () const

High-level interface
Users of discretized assets should use these methods in order to initialize, evolve and take the present value of the assets. They call the corresponding methods in the Lattice interface, to which we refer for documentation.

void initialize (const boost::shared_ptr< Lattice > &, Time t)

void rollback (Time to)

void partialRollback (Time to)

Real presentValue ()

Low-level interface
These methods (that developers should override when deriving from DiscretizedAsset) are to be used by numerical methods and not directly by users, with the exception of adjustValues(), preAdjustValues() and postAdjustValues() that can be used together with partialRollback().

virtual void reset (Size size)=0

void preAdjustValues ()

void postAdjustValues ()

void adjustValues ()

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

Protected Member Functions

bool isOnTime (Time t) const

virtual void preAdjustValuesImpl ()

virtual void postAdjustValuesImpl ()

Protected Attributes

Time time_

Time latestPreAdjustment_

Time latestPostAdjustment_

Array values_

Detailed Description

Discretized asset class used by numerical methods.

Member Function Documentation

virtual void reset (Size size) [pure virtual]

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

Implemented in DiscretizedOption, DiscretizedDiscountBond, DiscretizedDermanKaniDoubleBarrierOption, and DiscretizedDoubleBarrierOption.

void preAdjustValues ()

This method will be invoked after rollback and before any other asset (i.e., an option on this one) has any chance to look at the values. For instance, payments happening at times already spanned by the rollback will be added here.

This method is not virtual; derived classes must override the protected preAdjustValuesImpl() method instead.

void postAdjustValues ()

This method will be invoked after rollback and after any other asset had their chance to look at the values. For instance, payments happening at the present time (and therefore not included in an option to be exercised at this time) will be added here.

This method is not virtual; derived classes must override the protected postAdjustValuesImpl() method instead.

void adjustValues ()

This method performs both pre- and post-adjustment

virtual std::vector<Time> mandatoryTimes () const [pure 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.

Implemented in DiscretizedOption, DiscretizedDiscountBond, DiscretizedDermanKaniDoubleBarrierOption, and DiscretizedDoubleBarrierOption.

bool isOnTime (Time t) const [protected]

This method checks whether the asset was rolled at the given time.

virtual void preAdjustValuesImpl () [protected], [virtual]

This method performs the actual pre-adjustment

virtual void postAdjustValuesImpl () [protected], [virtual]

This method performs the actual post-adjustment

Reimplemented in DiscretizedOption, DiscretizedDermanKaniDoubleBarrierOption, and DiscretizedDoubleBarrierOption.

Author

Generated automatically by Doxygen for QuantLib from the source code.

Referenced By

auparse_get_time(3), xclock(1), xdf_set_conf(3).

adjustValues(3), isOnTime(3), latestPostAdjustment_(3), latestPreAdjustment_(3), mandatoryTimes(3), partialRollback(3), postAdjustValues(3), postAdjustValuesImpl(3), preAdjustValues(3), preAdjustValuesImpl(3), presentValue(3), ql-method(3), rollback(3), time(3), time_(3) and values_(3) are aliases of QuantLib_DiscretizedAsset(3).

Fri Sep 23 2016 Version 1.8.1 QuantLib