QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
TrinomialTree Class Reference

Recombining trinomial tree class. More...

#include <trinomialtree.hpp>

+ Inheritance diagram for TrinomialTree:
+ Collaboration diagram for TrinomialTree:

Classes

class  Branching
 

Public Types

enum  Branches { branches = 3 }
 

Public Member Functions

 TrinomialTree (const ext::shared_ptr< StochasticProcess1D > &process, const TimeGrid &timeGrid, bool isPositive=false)
 
Real dx (Size i) const
 
const TimeGridtimeGrid () const
 
Size size (Size i) const
 
Real underlying (Size i, Size index) const
 
Size descendant (Size i, Size index, Size branch) const
 
Real probability (Size i, Size index, Size branch) const
 
- Public Member Functions inherited from Tree< TrinomialTree >
 Tree (Size columns)
 
Size columns () const
 

Protected Attributes

std::vector< Branchingbranchings_
 
Real x0_
 
std::vector< Realdx_
 
TimeGrid timeGrid_
 

Additional Inherited Members

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

Detailed Description

Recombining trinomial tree class.

This class defines a recombining trinomial tree approximating a 1-D stochastic process.

Warning:
The diffusion term of the SDE must be independent of the underlying process.

Definition at line 41 of file trinomialtree.hpp.

Member Enumeration Documentation

◆ Branches

enum Branches
Enumerator
branches 

Definition at line 44 of file trinomialtree.hpp.

Constructor & Destructor Documentation

◆ TrinomialTree()

TrinomialTree ( const ext::shared_ptr< StochasticProcess1D > &  process,
const TimeGrid timeGrid,
bool  isPositive = false 
)

Definition at line 26 of file trinomialtree.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ dx()

Real dx ( Size  i) const

Definition at line 48 of file trinomialtree.hpp.

+ Here is the caller graph for this function:

◆ timeGrid()

const TimeGrid & timeGrid ( ) const

Definition at line 49 of file trinomialtree.hpp.

+ Here is the caller graph for this function:

◆ size()

Size size ( Size  i) const

Definition at line 84 of file trinomialtree.hpp.

◆ underlying()

Real underlying ( Size  i,
Size  index 
) const

Definition at line 88 of file trinomialtree.hpp.

+ Here is the call graph for this function:

◆ descendant()

Size descendant ( Size  i,
Size  index,
Size  branch 
) const

Definition at line 96 of file trinomialtree.hpp.

◆ probability()

Real probability ( Size  i,
Size  index,
Size  branch 
) const

Definition at line 101 of file trinomialtree.hpp.

Member Data Documentation

◆ branchings_

std::vector<Branching> branchings_
protected

Definition at line 57 of file trinomialtree.hpp.

◆ x0_

Real x0_
protected

Definition at line 58 of file trinomialtree.hpp.

◆ dx_

std::vector<Real> dx_
protected

Definition at line 59 of file trinomialtree.hpp.

◆ timeGrid_

TimeGrid timeGrid_
protected

Definition at line 60 of file trinomialtree.hpp.