31 termStructure_(
std::move(termStructure)) {
39 termStructure_(
std::move(termStructure)) {
50 ext::shared_ptr<TermStructureConsistentModel> tsmodel =
51 ext::dynamic_pointer_cast<TermStructureConsistentModel>(*
model_);
52 if (tsmodel !=
nullptr) {
53 referenceDate = tsmodel->termStructure()->referenceDate();
54 dayCounter = tsmodel->termStructure()->dayCounter();
61 ext::shared_ptr<Lattice> lattice;
68 lattice =
model_->tree(timeGrid);
Base class for cap-like instruments.
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
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 > &)
void calculate() const override
TreeCapFloorEngine(const ext::shared_ptr< ShortRateModel > &model, Size timeSteps, Handle< YieldTermStructure > termStructure=Handle< YieldTermStructure >())
Handle< YieldTermStructure > termStructure_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Abstract one-factor interest rate model class.
Numerical lattice engine for cap/floors.