28 Date startDate = valueDate(fixingDate);
29 Date endDate = maturityDate(startDate);
30 Time dcf = dayCounter_.yearFraction(startDate, endDate);
33 QL_REQUIRE(dcf > 0.0,
"Cannot calculate " << name() <<
" forward rate between " << startDate <<
" and " << endDate
34 <<
": non positive time (" << dcf <<
") using " << dayCounter_.name()
37 QL_REQUIRE(!termStructure_.empty(),
38 "Cannot calculate " << name() <<
" forward rate because term structure is empty");
42 DiscountFactor discountStart = termStructure_->discount(startDate);
43 DiscountFactor discountEnd = termStructure_->discount(endDate);
44 return pow(discountStart / discountEnd, 1.0 / dcf) - 1.0;
47QuantLib::ext::shared_ptr<IborIndex>
BRLCdi::clone(
const Handle<YieldTermStructure>& h)
const {
48 return QuantLib::ext::make_shared<BRLCdi>(h);
QuantLib::Rate forecastFixing(const QuantLib::Date &fixingDate) const override
QuantLib::ext::shared_ptr< IborIndex > clone(const QuantLib::Handle< QuantLib::YieldTermStructure > &h) const override
CompiledFormula pow(CompiledFormula x, const CompiledFormula &y)