Class Tree
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
columnsintThe number of columns, one per time of the tree's grid.
Exceptions
- ArgumentOutOfRangeException
columnsis negative.
Properties
Branches
Gets the number of branches from each node.
public abstract int Branches { get; }
Property Value
Columns
Gets the number of columns, one per time of the tree's grid.
public int Columns { get; }
Property Value
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
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
Returns
- double
The probability.
Size(int)
The number of nodes in a column.
public abstract int Size(int i)
Parameters
iintThe 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
Returns
- double
The value.