QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Tree< T > Class Template Reference

Tree approximating a single-factor diffusion More...

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

+ Inheritance diagram for Tree< T >:
+ Collaboration diagram for Tree< T >:

Public Member Functions

 Tree (Size columns)
 
Size columns () const
 

Private Attributes

Size columns_
 

Additional Inherited Members

- Protected Member Functions inherited from CuriouslyRecurringTemplate< T >
 CuriouslyRecurringTemplate ()=default
 
 ~CuriouslyRecurringTemplate ()=default
 
T & impl ()
 
const T & impl () const
 

Detailed Description

template<class T>
class QuantLib::Tree< T >

Tree approximating a single-factor diffusion

Derived classes must implement the following interface:

public:
Real underlying(Size i, Size index) const;
Size size(Size i) const;
Size descendant(Size i, Size index, Size branch) const;
Real probability(Size i, Size index, Size branch) const;
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58

and provide a public enumeration

enum { branches = N };

where N is a suitable constant (2 for binomial, 3 for trinomial...)

Definition at line 51 of file tree.hpp.

Constructor & Destructor Documentation

◆ Tree()

Tree ( Size  columns)
explicit

Definition at line 53 of file tree.hpp.

Member Function Documentation

◆ columns()

Size columns ( ) const

Definition at line 54 of file tree.hpp.

Member Data Documentation

◆ columns_

Size columns_
private

Definition at line 56 of file tree.hpp.