Table of Contents

Class Tree

Namespace
NanoQL.Methods
Assembly
NanoQL.dll

A tree approximating a single-factor diffusion.

public abstract class Tree
Inheritance
Tree
Derived
Inherited Members

Remarks

QuantLib's curiously recurring template: a derived tree implements Underlying(int, int), Size(int), Descendant(int, int, int) and Probability(int, int, int), and Branches, QuantLib's enum { branches = N } (2 for a binomial tree, 3 for a trinomial one). Immutable once built. An extension point, as in QuantLib: the trinomial tree derives from it, as later ports' binomial trees will.

Constructors

Tree(int)

Initializes a new instance of the Tree class.

protected Tree(int columns)

Parameters

columns int

The number of columns, one per time of the tree's grid.

Exceptions

ArgumentOutOfRangeException

columns is negative.

Properties

Branches

Gets the number of branches from each node.

public abstract int Branches { get; }

Property Value

int

Columns

Gets the number of columns, one per time of the tree's grid.

public int Columns { get; }

Property Value

int

Methods

Descendant(int, int, int)

The index, in the next column, of a node's descendant along a branch.

public abstract int Descendant(int i, int index, int branch)

Parameters

i int

The column.

index int

The node's index in the column.

branch int

The branch.

Returns

int

The descendant's index.

Probability(int, int, int)

The probability of a node's branch.

public abstract double Probability(int i, int index, int branch)

Parameters

i int

The column.

index int

The node's index in the column.

branch int

The branch.

Returns

double

The probability.

Size(int)

The number of nodes in a column.

public abstract int Size(int i)

Parameters

i int

The column.

Returns

int

The number of nodes.

Underlying(int, int)

The underlying variable's value at a node.

public abstract double Underlying(int i, int index)

Parameters

i int

The column.

index int

The node's index in the column.

Returns

double

The value.