Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

binomialTree Class Reference

#include <binomialTree.h>

List of all members.

Public Member Functions

 binomialTree (void)
 default constructor

 binomialTree (Real So, Real r, Real sigma, Real T, Natural n)
 Constructor.

 binomialTree (Real So, Real r, Real sigma, Real T, Natural n, Real u, Real d)
 binomialTree (const asset &theAsset, yieldCurve &yc, Real T, Natural n)
 binomialTree (const binomialTree &rhs)
binomialTreeoperator= (const binomialTree &rhs)
virtual ~binomialTree (void)
const valarray< Real > * getStockProcess (Natural step)
const valarray< Real > * getClaimProcess (Natural step)
Real getPrice ()
void runEngineConvertibleBond (PayOff thePayoff, Real ConversionRatio, Real CallPrice, Real PutPrice)
void runEngineCall (PayOff thePayoff)

Protected Member Functions

Real getSo () const
Real getRate (Natural timestep) const
Real getSigma () const
Real getMaturity () const
Natural getSteps () const
void constructStockProcess ()
void setClaimVariables (Real constantRate)
void setClaimVariables (yieldCurve &yc)

Private Member Functions

void copyObj (const binomialTree &rhs)

Private Attributes

Real _So
Real _sigma
Real _maturity
Natural _n
Real _dt
Real _u
Real _d
valarray< valarray< Real > > _stockProcess
valarray< valarray< Real > > _claimProcess
valarray< Real_discountFactor
valarray< Real_q
 risk neutral probability of an up move


Friends

ostream & operator<< (ostream &os, const binomialTree &bt)
ostream & operator<< (ostream &os, const binomialTree *bt)


Constructor & Destructor Documentation

binomialTree::binomialTree void   ) 
 

default constructor

Definition at line 3 of file binomialTree.cpp.

References _d, _dt, _n, _sigma, _u, BT_DEFAULT_MATURITY, BT_DEFAULT_RATE, BT_DEFAULT_SIGMA, BT_DEFAULT_SO, BT_DEFAULT_STEPS, constructStockProcess(), and setClaimVariables().

binomialTree::binomialTree Real  So,
Real  r,
Real  sigma,
Real  T,
Natural  n
 

Constructor.

Definition at line 20 of file binomialTree.cpp.

References _d, _dt, _u, constructStockProcess(), Natural, r, Real, and setClaimVariables().

binomialTree::binomialTree Real  So,
Real  r,
Real  sigma,
Real  T,
Natural  n,
Real  u,
Real  d
 

Definition at line 56 of file binomialTree.cpp.

References _dt, constructStockProcess(), Natural, r, Real, and setClaimVariables().

binomialTree::binomialTree const asset theAsset,
yieldCurve yc,
Real  T,
Natural  n
 

Definition at line 38 of file binomialTree.cpp.

References _d, _dt, _sigma, _u, constructStockProcess(), Natural, Real, and setClaimVariables().

binomialTree::binomialTree const binomialTree rhs  ) 
 

Definition at line 91 of file binomialTree.cpp.

References copyObj().

binomialTree::~binomialTree void   )  [virtual]
 

Definition at line 117 of file binomialTree.cpp.


Member Function Documentation

void binomialTree::constructStockProcess  )  [protected]
 

Definition at line 122 of file binomialTree.cpp.

References _claimProcess, _d, _n, _So, _stockProcess, _u, and Natural.

Referenced by binomialTree().

void binomialTree::copyObj const binomialTree rhs  )  [private]
 

Definition at line 102 of file binomialTree.cpp.

References _claimProcess, _d, _discountFactor, _dt, _maturity, _n, _q, _sigma, _So, _stockProcess, and _u.

Referenced by binomialTree(), and operator=().

const valarray< Real > * binomialTree::getClaimProcess Natural  step  ) 
 

Definition at line 149 of file binomialTree.cpp.

References _claimProcess, _n, and Natural.

Referenced by convertiblebond::fairvalue().

Real binomialTree::getMaturity  )  const [inline, protected]
 

Definition at line 61 of file binomialTree.h.

References Real.

Referenced by operator<<().

Real binomialTree::getPrice  ) 
 

Definition at line 157 of file binomialTree.cpp.

References _claimProcess, and _n.

Referenced by mainbinomialtree().

Real binomialTree::getRate Natural  timestep  )  const [inline, protected]
 

Definition at line 57 of file binomialTree.h.

References _discountFactor, _n, Natural, and Real.

Real binomialTree::getSigma  )  const [inline, protected]
 

Definition at line 60 of file binomialTree.h.

References _sigma, and Real.

Referenced by operator<<().

Real binomialTree::getSo  )  const [inline, protected]
 

Definition at line 56 of file binomialTree.h.

References _So, and Real.

Referenced by operator<<().

Natural binomialTree::getSteps  )  const [inline, protected]
 

Definition at line 62 of file binomialTree.h.

References _n, and Natural.

Referenced by operator<<().

const valarray< Real > * binomialTree::getStockProcess Natural  step  ) 
 

Definition at line 141 of file binomialTree.cpp.

References _n, _stockProcess, and Natural.

Referenced by mainbinomialtree().

binomialTree & binomialTree::operator= const binomialTree rhs  ) 
 

Definition at line 96 of file binomialTree.cpp.

References copyObj().

void binomialTree::runEngineCall PayOff  thePayoff  ) 
 

Definition at line 195 of file binomialTree.cpp.

References _claimProcess, _discountFactor, _n, _q, _stockProcess, PayOff::Call(), Integer, and Natural.

Referenced by mainbinomialtree().

void binomialTree::runEngineConvertibleBond PayOff  thePayoff,
Real  ConversionRatio,
Real  CallPrice,
Real  PutPrice
 

Definition at line 214 of file binomialTree.cpp.

References _claimProcess, _discountFactor, _n, _q, _stockProcess, PayOff::Convertible(), Integer, Natural, and Real.

Referenced by convertiblebond::fairvalue().

void binomialTree::setClaimVariables yieldCurve yc  )  [protected]
 

Definition at line 84 of file binomialTree.cpp.

References _d, _discountFactor, _dt, _n, _q, _u, yieldCurve::forwardDiscountFactor(), and Natural.

void binomialTree::setClaimVariables Real  constantRate  )  [protected]
 

Definition at line 74 of file binomialTree.cpp.

References _d, _discountFactor, _dt, _n, _q, _u, Natural, q, and Real.

Referenced by binomialTree().


Friends And Related Function Documentation

ostream& operator<< ostream &  os,
const binomialTree bt
[friend]
 

Definition at line 23 of file binomialTree.h.

ostream& operator<< ostream &  os,
const binomialTree bt
[friend]
 

Definition at line 162 of file binomialTree.cpp.


Member Data Documentation

valarray<valarray <Real> > binomialTree::_claimProcess [private]
 

Definition at line 77 of file binomialTree.h.

Referenced by constructStockProcess(), copyObj(), getClaimProcess(), getPrice(), operator<<(), runEngineCall(), and runEngineConvertibleBond().

Real binomialTree::_d [private]
 

Definition at line 73 of file binomialTree.h.

Referenced by binomialTree(), constructStockProcess(), copyObj(), operator<<(), and setClaimVariables().

valarray<Real> binomialTree::_discountFactor [private]
 

Definition at line 79 of file binomialTree.h.

Referenced by copyObj(), getRate(), operator<<(), runEngineCall(), runEngineConvertibleBond(), and setClaimVariables().

Real binomialTree::_dt [private]
 

Definition at line 71 of file binomialTree.h.

Referenced by binomialTree(), copyObj(), and setClaimVariables().

Real binomialTree::_maturity [private]
 

Definition at line 69 of file binomialTree.h.

Referenced by copyObj().

Natural binomialTree::_n [private]
 

Definition at line 70 of file binomialTree.h.

Referenced by binomialTree(), constructStockProcess(), copyObj(), getClaimProcess(), getPrice(), getRate(), getSteps(), getStockProcess(), operator<<(), runEngineCall(), runEngineConvertibleBond(), and setClaimVariables().

valarray<Real> binomialTree::_q [private]
 

risk neutral probability of an up move

Definition at line 82 of file binomialTree.h.

Referenced by copyObj(), operator<<(), runEngineCall(), runEngineConvertibleBond(), and setClaimVariables().

Real binomialTree::_sigma [private]
 

Definition at line 68 of file binomialTree.h.

Referenced by binomialTree(), copyObj(), and getSigma().

Real binomialTree::_So [private]
 

Definition at line 67 of file binomialTree.h.

Referenced by constructStockProcess(), copyObj(), and getSo().

valarray<valarray <Real> > binomialTree::_stockProcess [private]
 

Definition at line 75 of file binomialTree.h.

Referenced by constructStockProcess(), copyObj(), getStockProcess(), operator<<(), runEngineCall(), and runEngineConvertibleBond().

Real binomialTree::_u [private]
 

Definition at line 72 of file binomialTree.h.

Referenced by binomialTree(), constructStockProcess(), copyObj(), operator<<(), and setClaimVariables().


The documentation for this class was generated from the following files:
Note: Generated nightly - reload for latest version
Generated on Thu Dec 22 23:12:38 2005 for terreneuve by doxygen 1.3.6