29 const ext::shared_ptr<ShortRateModel>& model,
33 termStructure_(
std::move(termStructure)) {
38 const ext::shared_ptr<ShortRateModel>& model,
42 termStructure_(
std::move(termStructure)) {
53 ext::shared_ptr<TermStructureConsistentModel> tsmodel =
54 ext::dynamic_pointer_cast<TermStructureConsistentModel>(*
model_);
59 ext::shared_ptr<Lattice> lattice;
66 lattice =
model_->tree(timeGrid);
72 "Spread is not supported for trees other than OneFactorModel");
76 auto referenceDate = discountCurve->referenceDate();
77 auto dayCounter = discountCurve->dayCounter();
78 Time redemptionTime = dayCounter.yearFraction(referenceDate,
arguments_.redemptionDate);
80 callableBond.
initialize(lattice, redemptionTime);
Callable bond base class.
void initialize(const ext::shared_ptr< Lattice > &, Time t)
std::vector< Time > mandatoryTimes() const override
Handle< ModelType > model_
Shared handle to an observable.
bool empty() const
checks if the contained shared pointer points to anything
Engine for a short-rate model specialized on a lattice.
ext::shared_ptr< Lattice > lattice_
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Recombining trinomial tree discretizing the state variable.
void calculate() const override
Handle< YieldTermStructure > termStructure_
TreeCallableFixedRateBondEngine(const ext::shared_ptr< ShortRateModel > &, Size timeSteps, Handle< YieldTermStructure > termStructure=Handle< YieldTermStructure >())
void calculateWithSpread(Spread s) const
Discretized callable fixed-rate bond class.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
Real Spread
spreads on interest rates
std::size_t Size
size of a container
Abstract one-factor interest rate model class.
Numerical lattice engines for callable/puttable bonds.