25#ifndef quantlib_trinomial_tree_hpp
26#define quantlib_trinomial_tree_hpp
32 class StochasticProcess1D;
45 TrinomialTree(
const ext::shared_ptr<StochasticProcess1D>& process,
47 bool isPositive =
false);
59 std::vector<Real>
dx_;
76 std::vector<Integer>
k_;
77 std::vector<std::vector<Real> >
probs_;
93 static_cast<Real>(index))*
dx(i);
111 return k_[index] - jMin_ - 1 + branch;
116 return probs_[branch][index];
120 return jMax_ - jMin_ + 1;
135 probs_[0].push_back(p1);
136 probs_[1].push_back(p2);
137 probs_[2].push_back(p3);
139 kMin_ = std::min(kMin_, k);
141 kMax_ = std::max(kMax_, k);
Tree approximating a single-factor diffusion
std::vector< std::vector< Real > > probs_
std::vector< Integer > k_
void add(Integer k, Real p1, Real p2, Real p3)
Size descendant(Size index, Size branch) const
Real probability(Size index, Size branch) const
Recombining trinomial tree class.
Size descendant(Size i, Size index, Size branch) const
std::vector< Branching > branchings_
Real probability(Size i, Size index, Size branch) const
Real underlying(Size i, Size index) const
const TimeGrid & timeGrid() const
ext::function< Real(Real)> b
QL_INTEGER Integer
integer number
std::size_t Size
size of a container