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

Lattice (tree, finite-differences) base class More...

#include <numericalmethod.hpp>

+ Inheritance diagram for Lattice:
+ Collaboration diagram for Lattice:

Public Member Functions

 Lattice (TimeGrid timeGrid)
 
virtual ~Lattice ()=default
 
Inspectors
const TimeGridtimeGrid () const
 

Numerical method interface

These methods are to be used by discretized assets and must be overridden by developers implementing numerical methods. Users are advised to use the corresponding methods of DiscretizedAsset instead.

TimeGrid t_
 
virtual void initialize (DiscretizedAsset &, Time time) const =0
 initialize an asset at the given time. More...
 
virtual void rollback (DiscretizedAsset &, Time to) const =0
 
virtual void partialRollback (DiscretizedAsset &, Time to) const =0
 
virtual Real presentValue (DiscretizedAsset &) const =0
 computes the present value of an asset. More...
 
virtual Array grid (Time) const =0
 

Detailed Description

Lattice (tree, finite-differences) base class

Definition at line 37 of file numericalmethod.hpp.

Constructor & Destructor Documentation

◆ Lattice()

Lattice ( TimeGrid  timeGrid)
explicit

Definition at line 39 of file numericalmethod.hpp.

◆ ~Lattice()

virtual ~Lattice ( )
virtualdefault

Member Function Documentation

◆ timeGrid()

const TimeGrid & timeGrid ( ) const

Definition at line 44 of file numericalmethod.hpp.

+ Here is the caller graph for this function:

◆ initialize()

virtual void initialize ( DiscretizedAsset ,
Time  time 
) const
pure virtual

◆ rollback()

virtual void rollback ( DiscretizedAsset ,
Time  to 
) const
pure virtual

◆ partialRollback()

virtual void partialRollback ( DiscretizedAsset ,
Time  to 
) const
pure virtual

Roll back an asset until the given time, but do not perform the final adjustment.

Warning:
In version 0.3.7 and earlier, this method was called rollAlmostBack method and performed pre-adjustment. This is no longer true; when migrating your code, you'll have to replace calls such as:
method->rollAlmostBack(asset,t);
const DefaultType & t

with the two statements:

method->partialRollback(asset,t);
asset->preAdjustValues();

Implemented in TreeLattice< Impl >, TreeLattice< BlackScholesLattice< T > >, TreeLattice< OneFactorModel::ShortRateTree >, TreeLattice< TwoFactorModel::ShortRateTree >, and TsiveriotisFernandesLattice< T >.

◆ presentValue()

virtual Real presentValue ( DiscretizedAsset ) const
pure virtual

◆ grid()

virtual Array grid ( Time  ) const
pure virtual

Member Data Documentation

◆ t_

TimeGrid t_
protected

Definition at line 95 of file numericalmethod.hpp.