# QuantLib_Lattice man page

Lattice — Lattice (tree, finite-differences) base class

## Synopsis

`#include <ql/numericalmethod.hpp>`

Inherited by **TreeLattice< Impl >**, **TreeLattice< BlackScholesLattice< T > >**, **TreeLattice< OneFactorModel::ShortRateTree >**, and **TreeLattice< TwoFactorModel::ShortRateTree >**.

### Public Member Functions

Lattice(constTimeGrid&timeGrid)

virtualDisposable<Array>grid(Time) const =0

**Inspectors**

constTimeGrid&timeGrid() 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.

virtual voidinitialize(DiscretizedAsset&,Timetime) const =0

initialize an asset at the given time.

virtual voidrollback(DiscretizedAsset&,Timeto) const =0

virtual voidpartialRollback(DiscretizedAsset&,Timeto) const =0

virtualReal presentValue(DiscretizedAsset&) const =0

computes the present value of an asset.

### Protected Attributes

TimeGrid t_

## Detailed Description

Lattice (tree, finite-differences) base class

## Member Function Documentation

### virtual void rollback (DiscretizedAsset &, Time to) const [pure virtual]

Roll back an asset until the given time, performing any needed adjustment.

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

### 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);`

with the two statements:

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

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

## Author

Generated automatically by Doxygen for QuantLib from the source code.

## Referenced By

Lattice(3), t_(3) and timeGrid(3) are aliases of QuantLib_Lattice(3).