QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
TreeLattice2D< Impl, T > Class Template Reference

Two-dimensional tree-based lattice. More...

#include <ql/methods/lattices/lattice2d.hpp>

Inheritance diagram for TreeLattice2D< Impl, T >:

Public Member Functions

 TreeLattice2D (const ext::shared_ptr< T > &tree1, ext::shared_ptr< T > tree2, Real correlation)
Size size (Size i) const
Size descendant (Size i, Size index, Size branch) const
Real probability (Size i, Size index, Size branch) const
Public Member Functions inherited from TreeLattice< Impl >
 TreeLattice (const TimeGrid &timeGrid, Size n)
void initialize (DiscretizedAsset &, Time t) const override
 initialize an asset at the given time.
void rollback (DiscretizedAsset &, Time to) const override
void partialRollback (DiscretizedAsset &, Time to) const override
Real presentValue (DiscretizedAsset &) const override
 Computes the present value of an asset using Arrow-Debrew prices.
const ArraystatePrices (Size i) const
void stepback (Size i, const Array &values, Array &newValues) const
Public Member Functions inherited from Lattice
 Lattice (TimeGrid timeGrid)
const TimeGridtimeGrid () const

Protected Member Functions

Array grid (Time) const override
void computeStatePrices (Size until) const
Protected Member Functions inherited from CuriouslyRecurringTemplate< Impl >
Impl & impl ()
const Impl & impl () const

Protected Attributes

ext::shared_ptr< T > tree1_
ext::shared_ptr< T > tree2_
std::vector< ArraystatePrices_
TimeGrid t_

Detailed Description

template<class Impl, class T = TrinomialTree>
class QuantLib::TreeLattice2D< Impl, T >

Two-dimensional tree-based lattice.

This lattice is based on two trinomial trees and primarily used for the G2 short-rate model.

Member Function Documentation

◆ grid()

template<class Impl, class T = TrinomialTree>
Array grid ( Time ) const
overrideprotectedvirtual

Implements Lattice.