diff --git a/ql/experimental/inflation/yoycapfloortermpricesurface.hpp b/ql/experimental/inflation/yoycapfloortermpricesurface.hpp index 92aa0a5f66..820bde7df8 100644 --- a/ql/experimental/inflation/yoycapfloortermpricesurface.hpp +++ b/ql/experimental/inflation/yoycapfloortermpricesurface.hpp @@ -606,8 +606,6 @@ namespace QuantLib { } Date baseDate = - yoyIndex()->interpolated() ? - nominalTS_->referenceDate() - observationLag() : inflationPeriod(nominalTS_->referenceDate() - observationLag(), yoyIndex()->frequency()).first; // usually this base rate is known @@ -619,8 +617,7 @@ namespace QuantLib { auto pYITS = ext::make_shared>( nominalTS_->referenceDate(), baseDate, baseYoYRate, - yoyIndex()->frequency(), yoyIndex()->interpolated(), - dayCounter(), YYhelpers); + yoyIndex()->frequency(), dayCounter(), YYhelpers); pYITS->recalculate(); yoy_ = pYITS; // store diff --git a/ql/termstructures/inflation/inflationtraits.hpp b/ql/termstructures/inflation/inflationtraits.hpp index 52b89e767f..1c972e3de6 100644 --- a/ql/termstructures/inflation/inflationtraits.hpp +++ b/ql/termstructures/inflation/inflationtraits.hpp @@ -117,6 +117,7 @@ namespace QuantLib { // start of curve data static Date initialDate(const YoYInflationTermStructure* t) { + QL_DEPRECATED_DISABLE_WARNING if (t->hasExplicitBaseDate()) { return t->baseDate(); } else if (t->indexIsInterpolated()) { @@ -125,6 +126,7 @@ namespace QuantLib { return inflationPeriod(t->referenceDate() - t->observationLag(), t->frequency()).first; } + QL_DEPRECATED_ENABLE_WARNING } // value at reference date diff --git a/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp b/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp index 1d97ace3b8..8cb04c3358 100644 --- a/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp +++ b/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp @@ -44,6 +44,18 @@ namespace QuantLib { : public YoYInflationTermStructure, protected InterpolatedCurve { public: + InterpolatedYoYInflationCurve(const Date& referenceDate, + std::vector dates, + const std::vector& rates, + Frequency frequency, + const DayCounter& dayCounter, + const ext::shared_ptr& seasonality = {}, + const Interpolator& interpolator = Interpolator()); + + /*! \deprecated Use the overload without indexIsInterpolated. + Deprecated in version 1.37. + */ + [[deprecated("Use the overload without indexIsInterpolated")]] InterpolatedYoYInflationCurve(const Date& referenceDate, std::vector dates, const std::vector& rates, @@ -53,11 +65,11 @@ namespace QuantLib { const ext::shared_ptr& seasonality = {}, const Interpolator& interpolator = Interpolator()); - /*! \deprecated Use the other overload and pass the base date directly - as the first date in the vector instead of using a lag. + /*! \deprecated Use the overload without lag and indexIsInterpolated and + pass the base date as the first date in the vector. Deprecated in version 1.34. */ - QL_DEPRECATED + [[deprecated("Use the overload without lag and indexIsInterpolated and pass the base date as the first date in the vector")]] InterpolatedYoYInflationCurve(const Date& referenceDate, const Calendar& calendar, const DayCounter& dayCounter, @@ -94,6 +106,18 @@ namespace QuantLib { (or can't) provide the points for interpolation on construction. */ + InterpolatedYoYInflationCurve(const Date& referenceDate, + Date baseDate, + Rate baseYoYRate, + Frequency frequency, + const DayCounter& dayCounter, + const ext::shared_ptr& seasonality = {}, + const Interpolator& interpolator = Interpolator()); + + /*! \deprecated Use the overload without indexIsInterpolated. + Deprecated in version 1.37. + */ + [[deprecated("Use the overload without indexIsInterpolated")]] InterpolatedYoYInflationCurve(const Date& referenceDate, Date baseDate, Rate baseYoYRate, @@ -103,11 +127,11 @@ namespace QuantLib { const ext::shared_ptr& seasonality = {}, const Interpolator& interpolator = Interpolator()); - /*! \deprecated Use the other overload and pass the base date directly - instead of using a lag. + /*! \deprecated Use the overload without lag and indexIsInterpolated and + pass the base date as the first date in the vector. Deprecated in version 1.34. */ - QL_DEPRECATED + [[deprecated("Use the overload without lag and indexIsInterpolated and pass the base date as the first date in the vector")]] InterpolatedYoYInflationCurve(const Date& referenceDate, const Calendar& calendar, const DayCounter& dayCounter, @@ -130,12 +154,11 @@ namespace QuantLib { std::vector dates, const std::vector& rates, Frequency frequency, - bool indexIsInterpolated, const DayCounter& dayCounter, const ext::shared_ptr& seasonality, const Interpolator& interpolator) - : YoYInflationTermStructure(referenceDate, dates.at(0), rates[0], frequency, - indexIsInterpolated, dayCounter, seasonality), + : YoYInflationTermStructure(referenceDate, dates.at(0), rates[0], + frequency, dayCounter, seasonality), InterpolatedCurve(std::vector