From 53722a4574af0820ced0b91ad3e938cf29dfb1ca Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Fri, 19 Jul 2024 17:42:09 +0200 Subject: [PATCH] Remove features deprecated in version 1.31 --- QuantLib.vcxproj | 4 - QuantLib.vcxproj.filters | 12 -- cmake/GenerateHeaders.cmake | 4 - ql/CMakeLists.txt | 4 - ql/cashflows/conundrumpricer.hpp | 6 - ql/cashflows/cpicoupon.cpp | 100 ++----------- ql/cashflows/cpicoupon.hpp | 101 ++------------ ql/cashflows/cpicouponpricer.cpp | 29 +--- ql/cashflows/cpicouponpricer.hpp | 15 -- ql/experimental/inflation/genericindexes.hpp | 26 ---- ql/indexes/inflation/aucpi.hpp | 25 ---- ql/indexes/inflation/euhicp.hpp | 24 ---- ql/indexes/inflation/frhicp.hpp | 24 ---- ql/indexes/inflation/ukrpi.hpp | 24 ---- ql/indexes/inflation/uscpi.hpp | 24 ---- ql/indexes/inflation/zacpi.hpp | 24 ---- ql/indexes/inflationindex.cpp | 21 +-- ql/indexes/inflationindex.hpp | 22 --- ql/instruments/forwardrateagreement.cpp | 22 --- ql/instruments/forwardrateagreement.hpp | 26 ---- ql/math/Makefile.am | 4 +- ql/math/curve.hpp | 21 --- ql/math/lexicographicalview.hpp | 21 --- ql/models/volatility/garch.hpp | 17 --- ql/patterns/Makefile.am | 3 +- ql/patterns/composite.hpp | 21 --- ql/termstructures/yield/Makefile.am | 3 +- .../yield/drifttermstructure.hpp | 22 --- ql/timeseries.hpp | 95 ------------- ql/utilities/steppingiterator.hpp | 40 ------ test-suite/inflation.cpp | 132 ------------------ test-suite/timeseries.cpp | 21 --- 32 files changed, 28 insertions(+), 909 deletions(-) delete mode 100644 ql/math/curve.hpp delete mode 100644 ql/math/lexicographicalview.hpp delete mode 100644 ql/patterns/composite.hpp delete mode 100644 ql/termstructures/yield/drifttermstructure.hpp diff --git a/QuantLib.vcxproj b/QuantLib.vcxproj index e749bf55c86..ed7a79b4c3a 100644 --- a/QuantLib.vcxproj +++ b/QuantLib.vcxproj @@ -998,7 +998,6 @@ - @@ -1056,7 +1055,6 @@ - @@ -1465,7 +1463,6 @@ - @@ -1754,7 +1751,6 @@ - diff --git a/QuantLib.vcxproj.filters b/QuantLib.vcxproj.filters index a7d1b985bc2..ab32dccb410 100644 --- a/QuantLib.vcxproj.filters +++ b/QuantLib.vcxproj.filters @@ -981,9 +981,6 @@ math - - math - math @@ -1011,9 +1008,6 @@ math - - math - math @@ -1440,9 +1434,6 @@ patterns - - patterns - patterns @@ -2136,9 +2127,6 @@ termstructures\yield - - termstructures\yield - termstructures\yield diff --git a/cmake/GenerateHeaders.cmake b/cmake/GenerateHeaders.cmake index a93a7eb0e50..7e54c0a880c 100644 --- a/cmake/GenerateHeaders.cmake +++ b/cmake/GenerateHeaders.cmake @@ -52,10 +52,6 @@ function(generate_dir_headers source_dir binary_dir) list(FILTER children_hpp EXCLUDE REGEX "analyticcomplexchooserengine.hpp") endif () - list(FILTER children_hpp EXCLUDE REGEX "composite.hpp") - list(FILTER children_hpp EXCLUDE REGEX "lexicographicalview.hpp") - list(FILTER children_hpp EXCLUDE REGEX "^curve.hpp") - list(FILTER children_hpp EXCLUDE REGEX "drifttermstructure.hpp") list(FILTER children_hpp EXCLUDE REGEX "multicurvesensitivities.hpp") list(FILTER children_hpp EXCLUDE REGEX "shoutcondition.hpp") list(FILTER children_hpp EXCLUDE REGEX "fdcondition.hpp") diff --git a/ql/CMakeLists.txt b/ql/CMakeLists.txt index ba8e5d6e284..748eb1fff40 100644 --- a/ql/CMakeLists.txt +++ b/ql/CMakeLists.txt @@ -1414,7 +1414,6 @@ set(QL_HEADERS math/copulas/maxcopula.hpp math/copulas/mincopula.hpp math/copulas/plackettcopula.hpp - math/curve.hpp math/distributions/binomialdistribution.hpp math/distributions/bivariatenormaldistribution.hpp math/distributions/bivariatestudenttdistribution.hpp @@ -1469,7 +1468,6 @@ set(QL_HEADERS math/interpolations/sabrinterpolation.hpp math/interpolations/xabrinterpolation.hpp math/kernelfunctions.hpp - math/lexicographicalview.hpp math/linearleastsquaresregression.hpp math/matrix.hpp math/matrixutilities/basisincompleteordered.hpp @@ -1845,7 +1843,6 @@ set(QL_HEADERS numericalmethod.hpp option.hpp optional.hpp - patterns/composite.hpp patterns/curiouslyrecurring.hpp patterns/lazyobject.hpp patterns/observable.hpp @@ -2116,7 +2113,6 @@ set(QL_HEADERS termstructures/yield/bootstraptraits.hpp termstructures/yield/compositezeroyieldstructure.hpp termstructures/yield/discountcurve.hpp - termstructures/yield/drifttermstructure.hpp termstructures/yield/fittedbonddiscountcurve.hpp termstructures/yield/flatforward.hpp termstructures/yield/forwardcurve.hpp diff --git a/ql/cashflows/conundrumpricer.hpp b/ql/cashflows/conundrumpricer.hpp index 651139c1438..9021cea2a03 100644 --- a/ql/cashflows/conundrumpricer.hpp +++ b/ql/cashflows/conundrumpricer.hpp @@ -61,12 +61,6 @@ namespace QuantLib { ext::shared_ptr smile_; }; - /*! \deprecated Renamed to MarketQuotedOptionPricer. - Deprecated in version 1.31. - */ - [[deprecated("Renamed to MarketQuotedOptionPricer")]] - typedef MarketQuotedOptionPricer BlackVanillaOptionPricer; - class GFunction { public: virtual ~GFunction() = default; diff --git a/ql/cashflows/cpicoupon.cpp b/ql/cashflows/cpicoupon.cpp index dd3a0fb4ccb..16e66f8e044 100644 --- a/ql/cashflows/cpicoupon.cpp +++ b/ql/cashflows/cpicoupon.cpp @@ -29,8 +29,6 @@ namespace QuantLib { - QL_DEPRECATED_DISABLE_WARNING - CPICoupon::CPICoupon(Real baseCPI, const Date& paymentDate, Real nominal, @@ -44,9 +42,9 @@ namespace QuantLib { const Date& refPeriodStart, const Date& refPeriodEnd, const Date& exCouponDate) - : CPICoupon(baseCPI, paymentDate, nominal, startDate, endDate, index, - observationLag, observationInterpolation, dayCounter, - fixedRate, 0.0, refPeriodStart, refPeriodEnd, exCouponDate) {} + : CPICoupon(baseCPI, Null(), paymentDate, nominal, startDate, endDate, + index, observationLag, observationInterpolation, dayCounter, + fixedRate, refPeriodStart, refPeriodEnd, exCouponDate) {} CPICoupon::CPICoupon(const Date& baseDate, const Date& paymentDate, @@ -61,9 +59,9 @@ namespace QuantLib { const Date& refPeriodStart, const Date& refPeriodEnd, const Date& exCouponDate) - : CPICoupon(baseDate, paymentDate, nominal, startDate, endDate, index, - observationLag, observationInterpolation, dayCounter, - fixedRate, 0.0, refPeriodStart, refPeriodEnd, exCouponDate) {} + : CPICoupon(Null(), baseDate, paymentDate, nominal, startDate, endDate, + index, observationLag, observationInterpolation, dayCounter, + fixedRate, refPeriodStart, refPeriodEnd, exCouponDate) {} CPICoupon::CPICoupon(Real baseCPI, const Date& baseDate, @@ -79,77 +77,19 @@ namespace QuantLib { const Date& refPeriodStart, const Date& refPeriodEnd, const Date& exCouponDate) - : CPICoupon(baseCPI, baseDate, paymentDate, nominal, startDate, endDate, index, - observationLag, observationInterpolation, dayCounter, - fixedRate, 0.0, refPeriodStart, refPeriodEnd, exCouponDate) {} - - CPICoupon::CPICoupon(Real baseCPI, - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - Spread spread, - const Date& refPeriodStart, - const Date& refPeriodEnd, - const Date& exCouponDate) - : CPICoupon(baseCPI, Null(), paymentDate, nominal, startDate, endDate, index, - observationLag, observationInterpolation, dayCounter, - fixedRate, spread, refPeriodStart, refPeriodEnd, exCouponDate) {} - - CPICoupon::CPICoupon(const Date& baseDate, - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - Spread spread, - const Date& refPeriodStart, - const Date& refPeriodEnd, - const Date& exCouponDate) - : CPICoupon(Null(), baseDate, paymentDate, nominal, startDate, endDate, index, - observationLag, observationInterpolation, dayCounter, - fixedRate, spread, refPeriodStart, refPeriodEnd, exCouponDate) {} - - CPICoupon::CPICoupon(Real baseCPI, - const Date& baseDate, - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - Spread spread, - const Date& refPeriodStart, - const Date& refPeriodEnd, - const Date& exCouponDate) : InflationCoupon(paymentDate, nominal, startDate, endDate, 0, index, observationLag, dayCounter, refPeriodStart, refPeriodEnd, exCouponDate), - baseCPI_(baseCPI), fixedRate_(fixedRate), spread_(spread), + baseCPI_(baseCPI), fixedRate_(fixedRate), observationInterpolation_(observationInterpolation), baseDate_(baseDate) { QL_REQUIRE(index_, "no index provided"); - QL_REQUIRE( - baseCPI_ != Null() || baseDate != Null(), - "baseCPI and baseDate can not be both null, provide a valid baseCPI or baseDate"); + QL_REQUIRE(baseCPI_ != Null() || baseDate != Null(), + "baseCPI and baseDate can not be both null, provide a valid baseCPI or baseDate"); QL_REQUIRE(baseCPI_ == Null() || std::fabs(baseCPI_) > 1e-16, "|baseCPI_| < 1e-16, future divide-by-zero problem"); } - QL_DEPRECATED_ENABLE_WARNING - void CPICoupon::accept(AcyclicVisitor& v) { auto* v1 = dynamic_cast*>(&v); if (v1 != nullptr) @@ -261,8 +201,7 @@ namespace QuantLib { const Period& observationLag) : schedule_(std::move(schedule)), index_(std::move(index)), baseCPI_(baseCPI), observationLag_(observationLag), paymentDayCounter_(Thirty360(Thirty360::BondBasis)), - paymentCalendar_(schedule_.calendar()), - spreads_(std::vector(1, 0)), baseDate_(Null()) {} + paymentCalendar_(schedule_.calendar()), baseDate_(Null()) {} CPILeg& CPILeg::withObservationInterpolation(CPI::InterpolationType interp) { @@ -311,16 +250,6 @@ namespace QuantLib { return *this; } - CPILeg& CPILeg::withSpreads(Spread spread) { - spreads_ = std::vector(1,spread); - return *this; - } - - CPILeg& CPILeg::withSpreads(const std::vector& spreads) { - spreads_ = spreads; - return *this; - } - CPILeg& CPILeg::withCaps(Rate cap) { caps_ = std::vector(1,cap); return *this; @@ -371,8 +300,7 @@ namespace QuantLib { // should be at startDate - observationLag if (n>0) { - QL_REQUIRE(!fixedRates_.empty() || !spreads_.empty(), - "no fixedRates or spreads given"); + QL_REQUIRE(!fixedRates_.empty(), "no fixedRates given"); if (baseDate_ == Null() && baseCPI_ == Null()) { baseDate = schedule_.date(0) - observationLag_; @@ -403,13 +331,13 @@ namespace QuantLib { refEnd = schedule_.calendar().adjust(start + schedule_.tenor(), bdc); } if (detail::get(fixedRates_, i, 1.0) == 0.0) { // fixed coupon + // this looks like an optimization but I'm not sure it's worth it? leg.push_back(ext::make_shared (paymentDate, detail::get(notionals_, i, 0.0), - detail::effectiveFixedRate(spreads_,caps_,floors_,i), + detail::effectiveFixedRate({},caps_,floors_,i), paymentDayCounter_, start, end, refStart, refEnd, exCouponDate)); } else { // zero inflation coupon if (detail::noOption(caps_, floors_, i)) { // just swaplet - QL_DEPRECATED_DISABLE_WARNING leg.push_back(ext::make_shared (baseCPI_, // all have same base for ratio baseDate, @@ -420,9 +348,7 @@ namespace QuantLib { observationInterpolation_, paymentDayCounter_, detail::get(fixedRates_, i, 0.0), - detail::get(spreads_, i, 0.0), refStart, refEnd, exCouponDate)); - QL_DEPRECATED_ENABLE_WARNING } else { // cap/floorlet QL_FAIL("caps/floors on CPI coupons not implemented."); } diff --git a/ql/cashflows/cpicoupon.hpp b/ql/cashflows/cpicoupon.hpp index 68445a3b1d5..8ffe3719b99 100644 --- a/ql/cashflows/cpicoupon.hpp +++ b/ql/cashflows/cpicoupon.hpp @@ -56,6 +56,7 @@ namespace QuantLib { public: //! \name Constructors //@{ + /*! This constructor takes the base CPI to be used in the calculations. */ CPICoupon(Real baseCPI, const Date& paymentDate, Real nominal, @@ -70,40 +71,10 @@ namespace QuantLib { const Date& refPeriodEnd = Date(), const Date& exCouponDate = Date()); - CPICoupon(const Date& baseDate, // user provided, could be arbitrary - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - const Date& refPeriodStart = Date(), - const Date& refPeriodEnd = Date(), - const Date& exCouponDate = Date()); - - CPICoupon(Real baseCPI, // user provided, could be arbitrary - const Date& baseDate, - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - const Date& refPeriodStart = Date(), - const Date& refPeriodEnd = Date(), - const Date& exCouponDate = Date()); - - /*! \deprecated Use one of the constructors without spread. - Deprecated in version 1.31. + /*! This constructor takes a base date; the coupon will use it + to retrieve the base CPI to be used in the calculations. */ - QL_DEPRECATED - CPICoupon(Real baseCPI, // user provided, could be arbitrary + CPICoupon(const Date& baseDate, const Date& paymentDate, Real nominal, const Date& startDate, @@ -113,35 +84,14 @@ namespace QuantLib { CPI::InterpolationType observationInterpolation, const DayCounter& dayCounter, Real fixedRate, - Spread spread, const Date& refPeriodStart = Date(), const Date& refPeriodEnd = Date(), const Date& exCouponDate = Date()); - /*! \deprecated Use one of the constructors without spread. - Deprecated in version 1.31. + /*! This constructor takes both a base CPI and a base date. + If both are passed, the base CPI is used in the calculations. */ - QL_DEPRECATED - CPICoupon(const Date& baseDate, // user provided, could be arbitrary - const Date& paymentDate, - Real nominal, - const Date& startDate, - const Date& endDate, - const ext::shared_ptr& index, - const Period& observationLag, - CPI::InterpolationType observationInterpolation, - const DayCounter& dayCounter, - Real fixedRate, - Spread spread, - const Date& refPeriodStart = Date(), - const Date& refPeriodEnd = Date(), - const Date& exCouponDate = Date()); - - /*! \deprecated Use one of the constructors without spread. - Deprecated in version 1.31. - */ - QL_DEPRECATED - CPICoupon(Real baseCPI, // user provided, could be arbitrary + CPICoupon(Real baseCPI, const Date& baseDate, const Date& paymentDate, Real nominal, @@ -152,27 +102,16 @@ namespace QuantLib { CPI::InterpolationType observationInterpolation, const DayCounter& dayCounter, Real fixedRate, - Spread spread, const Date& refPeriodStart = Date(), const Date& refPeriodEnd = Date(), const Date& exCouponDate = Date()); //@} - QL_DEPRECATED_DISABLE_WARNING - ~CPICoupon() override = default; - QL_DEPRECATED_ENABLE_WARNING - //! \name Inspectors //@{ //! fixed rate that will be inflated by the index ratio Real fixedRate() const; - /*! \deprecated Do not use this method. A spread doesn't make sense for this coupon. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this method. A spread doesn't make sense for this coupon.")]] - Spread spread() const; - //! base value for the CPI index /*! \warning make sure that the interpolation used to create this is what you are using for the fixing, @@ -213,11 +152,6 @@ namespace QuantLib { protected: Real baseCPI_; Real fixedRate_; - /*! \deprecated Don't use this data member. A spread doesn't make sense for this coupon. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this data member. A spread doesn't make sense for this coupon.")]] - Spread spread_; CPI::InterpolationType observationInterpolation_; Date baseDate_; @@ -289,16 +223,6 @@ namespace QuantLib { CPILeg& withPaymentCalendar(const Calendar&); CPILeg& withObservationInterpolation(CPI::InterpolationType); CPILeg& withSubtractInflationNominal(bool); - /*! \deprecated Do not use this method. A spread doesn't make sense for these coupons. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this method. A spread doesn't make sense for these coupons.")]] - CPILeg& withSpreads(Spread spread); - /*! \deprecated Do not use this method. A spread doesn't make sense for these coupons. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this method. A spread doesn't make sense for these coupons.")]] - CPILeg& withSpreads(const std::vector& spreads); CPILeg& withCaps(Rate cap); CPILeg& withCaps(const std::vector& caps); CPILeg& withFloors(Rate floor); @@ -323,7 +247,6 @@ namespace QuantLib { Calendar paymentCalendar_; CPI::InterpolationType observationInterpolation_ = CPI::AsIndex; bool subtractInflationNominal_ = true; - std::vector spreads_; std::vector caps_, floors_; Period exCouponPeriod_; Calendar exCouponCalendar_; @@ -339,16 +262,8 @@ namespace QuantLib { return fixedRate_; } - inline Real CPICoupon::spread() const { - QL_DEPRECATED_DISABLE_WARNING - return spread_; - QL_DEPRECATED_ENABLE_WARNING - } - inline Rate CPICoupon::adjustedIndexGrowth() const { - QL_DEPRECATED_DISABLE_WARNING - return (rate()-spread())/fixedRate(); - QL_DEPRECATED_ENABLE_WARNING + return rate()/fixedRate(); } inline Rate CPICoupon::indexFixing() const { diff --git a/ql/cashflows/cpicouponpricer.cpp b/ql/cashflows/cpicouponpricer.cpp index afd937c9355..ccdafde2fa4 100644 --- a/ql/cashflows/cpicouponpricer.cpp +++ b/ql/cashflows/cpicouponpricer.cpp @@ -23,8 +23,6 @@ namespace QuantLib { - QL_DEPRECATED_DISABLE_WARNING - CPICouponPricer::CPICouponPricer(Handle nominalTermStructure) : nominalTermStructure_(std::move(nominalTermStructure)) { registerWith(nominalTermStructure_); @@ -37,8 +35,6 @@ namespace QuantLib { registerWith(nominalTermStructure_); } - QL_DEPRECATED_ENABLE_WARNING - void CPICouponPricer::setCapletVolatility( const Handle& capletVol) { QL_REQUIRE(!capletVol.empty(),"empty capletVol handle"); @@ -103,30 +99,17 @@ namespace QuantLib { Real stdDev = std::sqrt(capletVolatility()->totalVariance(fixingDate, effStrike)); - QL_DEPRECATED_DISABLE_WARNING return optionletPriceImp(optionType, effStrike, - adjustedFixing(), + coupon_->indexRatio(coupon_->accrualEndDate()), stdDev); - QL_DEPRECATED_ENABLE_WARNING } } - Rate CPICouponPricer::adjustedFixing(Rate fixing) const { - if (fixing != Null()) - return fixing; - - return coupon_->indexRatio(coupon_->accrualEndDate()); - } - - void CPICouponPricer::initialize(const InflationCoupon& coupon) { coupon_ = dynamic_cast(&coupon); gearing_ = coupon_->fixedRate(); - QL_DEPRECATED_DISABLE_WARNING - spread_ = coupon_->spread(); - QL_DEPRECATED_ENABLE_WARNING paymentDate_ = coupon_->date(); // past or future fixing is managed in YoYInflationIndex::fixing() @@ -150,18 +133,12 @@ namespace QuantLib { Rate CPICouponPricer::swapletRate() const { - QL_DEPRECATED_DISABLE_WARNING - return gearing_ * adjustedFixing() + spread_; - QL_DEPRECATED_ENABLE_WARNING - // after deprecating and removing adjustedFixing: - // return accruedRate(coupon_->accrualEndDate()); + return accruedRate(coupon_->accrualEndDate()); } Rate CPICouponPricer::accruedRate(Date settlementDate) const { - QL_DEPRECATED_DISABLE_WARNING - return gearing_ * coupon_->indexRatio(settlementDate) + spread_; - QL_DEPRECATED_ENABLE_WARNING + return gearing_ * coupon_->indexRatio(settlementDate); } } diff --git a/ql/cashflows/cpicouponpricer.hpp b/ql/cashflows/cpicouponpricer.hpp index 601d4f5aaee..ed3a8407e88 100644 --- a/ql/cashflows/cpicouponpricer.hpp +++ b/ql/cashflows/cpicouponpricer.hpp @@ -43,10 +43,6 @@ namespace QuantLib { explicit CPICouponPricer(Handle capletVol, Handle nominalTermStructure = Handle()); - QL_DEPRECATED_DISABLE_WARNING - ~CPICouponPricer() override = default; - QL_DEPRECATED_ENABLE_WARNING - virtual Handle capletVolatility() const{ return capletVol_; } @@ -88,22 +84,11 @@ namespace QuantLib { virtual Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const; - /*! \deprecated Don't use this method. In derived classes, override accruedRate. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this method. In derived classes, override accruedRate.")]] - virtual Rate adjustedFixing(Rate fixing = Null()) const; - // data Handle capletVol_; Handle nominalTermStructure_; const CPICoupon* coupon_; Real gearing_; - /*! \deprecated Don't use this data member. A spread doesn't make sense for this coupon. - Deprecated in version 1.31. - */ - [[deprecated("Do not use this data member. A spread doesn't make sense for these coupons.")]] - Spread spread_; Real discount_; }; diff --git a/ql/experimental/inflation/genericindexes.hpp b/ql/experimental/inflation/genericindexes.hpp index dc3a9866119..41311c727fb 100644 --- a/ql/experimental/inflation/genericindexes.hpp +++ b/ql/experimental/inflation/genericindexes.hpp @@ -72,32 +72,6 @@ namespace QuantLib { ts) {} }; - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year GenericCPI (i.e. a ratio) - /*! \deprecated Pass a zero-inflation index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass a zero-inflation index to YoYInflationIndex instead")]] YYGenericCPIr : public YoYInflationIndex { - public: - YYGenericCPIr(Frequency frequency, - bool revised, - bool interpolated, - const Period &lag, - const Currency &ccy, - const Handle& ts = {}) - : YoYInflationIndex("YYR_CPI", - GenericRegion(), - revised, - interpolated, - true, - frequency, - lag, - ccy, - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } #endif diff --git a/ql/indexes/inflation/aucpi.hpp b/ql/indexes/inflation/aucpi.hpp index 0566d4dfc34..9cff08c7c75 100644 --- a/ql/indexes/inflation/aucpi.hpp +++ b/ql/indexes/inflation/aucpi.hpp @@ -58,31 +58,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year AUCPI (i.e. a ratio) - /*! \deprecated Pass the AUCPI index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the AUCPI index to YoYInflationIndex instead")]] YYAUCPIr : public YoYInflationIndex { - public: - YYAUCPIr(Frequency frequency, - bool revised, - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_CPI", - AustraliaRegion(), - revised, - interpolated, - true, - frequency, - Period(2, Months), - AUDCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } #endif diff --git a/ql/indexes/inflation/euhicp.hpp b/ql/indexes/inflation/euhicp.hpp index 2f8d5b6a7bd..41f2f890d02 100644 --- a/ql/indexes/inflation/euhicp.hpp +++ b/ql/indexes/inflation/euhicp.hpp @@ -90,30 +90,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year EU HICP (i.e. a ratio of EU HICP) - /*! \deprecated Pass the EUHICP index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the EUHICP index to YoYInflationIndex instead")]] YYEUHICPr : public YoYInflationIndex { - public: - explicit YYEUHICPr( - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_HICP", - EURegion(), - false, - interpolated, - true, - Monthly, - Period(1, Months), - EURCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } diff --git a/ql/indexes/inflation/frhicp.hpp b/ql/indexes/inflation/frhicp.hpp index 637a5423c23..a459ed27ca2 100644 --- a/ql/indexes/inflation/frhicp.hpp +++ b/ql/indexes/inflation/frhicp.hpp @@ -55,30 +55,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year FR HICP (i.e. a ratio) - /*! \deprecated Pass the FRHICP index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the FRHICP index to YoYInflationIndex instead")]] YYFRHICPr : public YoYInflationIndex { - public: - explicit YYFRHICPr( - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_HICP", - FranceRegion(), - false, - interpolated, - true, - Monthly, - Period(1, Months), - EURCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } #endif diff --git a/ql/indexes/inflation/ukrpi.hpp b/ql/indexes/inflation/ukrpi.hpp index b0c6579eb39..e24b12e6952 100644 --- a/ql/indexes/inflation/ukrpi.hpp +++ b/ql/indexes/inflation/ukrpi.hpp @@ -55,30 +55,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year UK RPI (i.e. a ratio of UK RPI) - /*! \deprecated Pass the UKRPI index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the UKRPI index to YoYInflationIndex instead")]] YYUKRPIr : public YoYInflationIndex { - public: - explicit YYUKRPIr( - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_RPI", - UKRegion(), - false, - interpolated, - true, - Monthly, - Period(1, Months), - GBPCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } diff --git a/ql/indexes/inflation/uscpi.hpp b/ql/indexes/inflation/uscpi.hpp index 7db2ade9cff..d8ffa1243f7 100644 --- a/ql/indexes/inflation/uscpi.hpp +++ b/ql/indexes/inflation/uscpi.hpp @@ -60,30 +60,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year US CPI (i.e. a ratio of US CPI) - /*! \deprecated Pass the USCPI index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the USCPI index to YoYInflationIndex instead")]] YYUSCPIr : public YoYInflationIndex { - public: - explicit YYUSCPIr( - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_CPI", - USRegion(), - false, - interpolated, - true, - Monthly, - Period(1, Months), - USDCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } diff --git a/ql/indexes/inflation/zacpi.hpp b/ql/indexes/inflation/zacpi.hpp index afe95855afd..c5b966a5d20 100644 --- a/ql/indexes/inflation/zacpi.hpp +++ b/ql/indexes/inflation/zacpi.hpp @@ -55,30 +55,6 @@ namespace QuantLib { ts) {} }; - - QL_DEPRECATED_DISABLE_WARNING - - //! Year-on-year South African CPI (i.e. a ratio of ZA CPI) - /*! \deprecated Pass the ZACPI index to YoYInflationIndex instead. - Deprecated in version 1.31. - */ - class [[deprecated("Pass the ZACPI index to YoYInflationIndex instead")]] YYZACPIr : public YoYInflationIndex { - public: - explicit YYZACPIr( - bool interpolated, - const Handle& ts = {}) - : YoYInflationIndex("YYR_CPI", - ZARegion(), - false, - interpolated, - true, - Monthly, - Period(1, Months), - ZARCurrency(), - ts) {} - }; - - QL_DEPRECATED_ENABLE_WARNING } diff --git a/ql/indexes/inflationindex.cpp b/ql/indexes/inflationindex.cpp index df9ff801aa7..fe90a776bef 100644 --- a/ql/indexes/inflationindex.cpp +++ b/ql/indexes/inflationindex.cpp @@ -204,35 +204,16 @@ namespace QuantLib { registerWith(yoyInflation_); } - QL_DEPRECATED_DISABLE_WARNING - - YoYInflationIndex::YoYInflationIndex(const std::string& familyName, - const Region& region, - bool revised, - bool interpolated, - Frequency frequency, - const Period& availabilityLag, - const Currency& currency, - Handle yoyInflation) - : YoYInflationIndex(familyName, region, revised, interpolated, false, - frequency, availabilityLag, currency, std::move(yoyInflation)) {} - - QL_DEPRECATED_ENABLE_WARNING - YoYInflationIndex::YoYInflationIndex(const std::string& familyName, const Region& region, bool revised, bool interpolated, - bool ratio, Frequency frequency, const Period& availabilityLag, const Currency& currency, Handle yoyInflation) : InflationIndex(familyName, region, revised, frequency, availabilityLag, currency), - interpolated_(interpolated), ratio_(ratio), yoyInflation_(std::move(yoyInflation)) { - if (ratio) - underlyingIndex_ = ext::make_shared(familyName, region, revised, - frequency, availabilityLag, currency); + interpolated_(interpolated), ratio_(false), yoyInflation_(std::move(yoyInflation)) { registerWith(yoyInflation_); } diff --git a/ql/indexes/inflationindex.hpp b/ql/indexes/inflationindex.hpp index 008ed1d29f5..18cb8cc419f 100644 --- a/ql/indexes/inflationindex.hpp +++ b/ql/indexes/inflationindex.hpp @@ -211,28 +211,6 @@ namespace QuantLib { const Currency& currency, Handle ts = {}); - //! Old generic constructor for year-on-year indices. - /*! An index built with this constructor needs its past - fixings to be stored via the `addFixing` or `addFixings` - method. Care must be taken about what to store: if - `ratio` is false, the stored values must be the - year-on-year values; if `ratio` is true, they must be the - past fixings of the underlying index. - - \deprecated Use one of the other constructors instead. - Deprecated in version 1.31. - */ - QL_DEPRECATED - YoYInflationIndex( - const std::string& familyName, - const Region& region, - bool revised, - bool interpolated, - bool ratio, // is this one a genuine index or a ratio? - Frequency frequency, - const Period& availabilityLag, - const Currency& currency, - Handle ts = {}); //@} //! \name Index interface diff --git a/ql/instruments/forwardrateagreement.cpp b/ql/instruments/forwardrateagreement.cpp index a4285414de7..91fbbf13c98 100644 --- a/ql/instruments/forwardrateagreement.cpp +++ b/ql/instruments/forwardrateagreement.cpp @@ -25,28 +25,6 @@ namespace QuantLib { - ForwardRateAgreement::ForwardRateAgreement(const Date& valueDate, - const Date& maturityDate, - Position::Type type, - Rate strikeForwardRate, - Real notionalAmount, - const ext::shared_ptr& index, - Handle discountCurve, - bool useIndexedCoupon) - : ForwardRateAgreement(index, valueDate, maturityDate, type, strikeForwardRate, - notionalAmount, std::move(discountCurve)) { - useIndexedCoupon_ = useIndexedCoupon; - } - - ForwardRateAgreement::ForwardRateAgreement(const Date& valueDate, - Position::Type type, - Rate strikeForwardRate, - Real notionalAmount, - const ext::shared_ptr& index, - Handle discountCurve) - : ForwardRateAgreement(index, valueDate, type, strikeForwardRate, - notionalAmount, std::move(discountCurve)) {} - ForwardRateAgreement::ForwardRateAgreement(const ext::shared_ptr& index, const Date& valueDate, Position::Type type, diff --git a/ql/instruments/forwardrateagreement.hpp b/ql/instruments/forwardrateagreement.hpp index c4329d43311..fccd0f97408 100644 --- a/ql/instruments/forwardrateagreement.hpp +++ b/ql/instruments/forwardrateagreement.hpp @@ -65,32 +65,6 @@ namespace QuantLib { */ class ForwardRateAgreement: public Instrument { public: - /*! \deprecated Use one of the other constructors. - Deprecated in version 1.31. - */ - QL_DEPRECATED - ForwardRateAgreement( - const Date& valueDate, - const Date& maturityDate, - Position::Type type, - Rate strikeForwardRate, - Real notionalAmount, - const ext::shared_ptr& index, - Handle discountCurve = {}, - bool useIndexedCoupon = true); - - /*! \deprecated Use one of the other constructors. - Deprecated in version 1.31. - */ - QL_DEPRECATED - ForwardRateAgreement( - const Date& valueDate, - Position::Type type, - Rate strikeForwardRate, - Real notionalAmount, - const ext::shared_ptr& index, - Handle discountCurve = {}); - /*! When using this constructor, the forward rate will be forecast by the passed index. This corresponds to useIndexedCoupon=true in the FraRateHelper class. diff --git a/ql/math/Makefile.am b/ql/math/Makefile.am index 535de3132a5..46ccd1efc77 100644 --- a/ql/math/Makefile.am +++ b/ql/math/Makefile.am @@ -15,7 +15,6 @@ this_include_HEADERS = \ beta.hpp \ bspline.hpp \ comparison.hpp \ - curve.hpp \ errorfunction.hpp \ expm1.hpp \ factorial.hpp \ @@ -25,7 +24,6 @@ this_include_HEADERS = \ kernelfunctions.hpp \ incompletegamma.hpp \ interpolation.hpp \ - lexicographicalview.hpp \ linearleastsquaresregression.hpp \ matrix.hpp \ modifiedbessel.hpp \ @@ -94,7 +92,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp curve.hpp lexicographicalview.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/math/curve.hpp b/ql/math/curve.hpp deleted file mode 100644 index c1214daa896..00000000000 --- a/ql/math/curve.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2006 Joseph Wang - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.31 -#pragma message("Warning: this file is empty and will disappear in a future release. Do not include it.") diff --git a/ql/math/lexicographicalview.hpp b/ql/math/lexicographicalview.hpp deleted file mode 100644 index ab0219f6303..00000000000 --- a/ql/math/lexicographicalview.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.31 -#pragma message("Warning: this file is empty and will disappear in a future release. Do not include it.") diff --git a/ql/models/volatility/garch.hpp b/ql/models/volatility/garch.hpp index ed58758a54e..651f1b4431d 100644 --- a/ql/models/volatility/garch.hpp +++ b/ql/models/volatility/garch.hpp @@ -39,23 +39,6 @@ namespace QuantLib { public: typedef TimeSeries time_series; - /*! \deprecated Use auto or time_series::const_iterator instead. - Deprecated in version 1.31. - */ - [[deprecated("If needed, use time_series::const_iterator instead.")]] - typedef time_series::const_iterator const_iterator; - - QL_DEPRECATED_DISABLE_WARNING - - /*! \deprecated If needed, use auto or time_series::const_value_iterator. - Prefer time_series::const_iterator instead. - Deprecated in version 1.31. - */ - [[deprecated("If needed, use auto or time_series::const_value_iterator. Prefer time_series::const_iterator instead.")]] - typedef time_series::const_value_iterator const_value_iterator; - - QL_DEPRECATED_ENABLE_WARNING - enum Mode { MomentMatchingGuess, /*!< The initial guess is a moment matching estimates for diff --git a/ql/patterns/Makefile.am b/ql/patterns/Makefile.am index 9bbb58170e9..cb5bd43e709 100644 --- a/ql/patterns/Makefile.am +++ b/ql/patterns/Makefile.am @@ -4,7 +4,6 @@ AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir} this_includedir=${includedir}/${subdir} this_include_HEADERS = \ all.hpp \ - composite.hpp \ curiouslyrecurring.hpp \ lazyobject.hpp \ observable.hpp \ @@ -40,7 +39,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp composite.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/patterns/composite.hpp b/ql/patterns/composite.hpp deleted file mode 100644 index 37227b53931..00000000000 --- a/ql/patterns/composite.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2003 StatPro Italia srl - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.31 -#pragma message("Warning: this file is empty and will disappear in a future release. Do not include it.") diff --git a/ql/termstructures/yield/Makefile.am b/ql/termstructures/yield/Makefile.am index 33b9199e84c..8480f51face 100644 --- a/ql/termstructures/yield/Makefile.am +++ b/ql/termstructures/yield/Makefile.am @@ -8,7 +8,6 @@ this_include_HEADERS = \ bootstraptraits.hpp \ compositezeroyieldstructure.hpp \ discountcurve.hpp \ - drifttermstructure.hpp \ fittedbonddiscountcurve.hpp \ flatforward.hpp \ forwardcurve.hpp \ @@ -65,7 +64,7 @@ all.hpp: Makefile.am echo "/* This file is automatically generated; do not edit. */" > ${srcdir}/$@ echo "/* Add the files to be included into Makefile.am instead. */" >> ${srcdir}/$@ echo >> ${srcdir}/$@ - for i in $(filter-out all.hpp drifttermstructure.hpp, $(this_include_HEADERS)); do \ + for i in $(filter-out all.hpp, $(this_include_HEADERS)); do \ echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ done echo >> ${srcdir}/$@ diff --git a/ql/termstructures/yield/drifttermstructure.hpp b/ql/termstructures/yield/drifttermstructure.hpp deleted file mode 100644 index bdedf14bc08..00000000000 --- a/ql/termstructures/yield/drifttermstructure.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2003 Ferdinando Ametrano - Copyright (C) 2008 StatPro Italia srl - - This file is part of QuantLib, a free-software/open-source library - for financial quantitative analysts and developers - http://quantlib.org/ - - QuantLib is free software: you can redistribute it and/or modify it - under the terms of the QuantLib license. You should have received a - copy of the license along with this program; if not, please email - . The license is also available online at - . - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the license for more details. -*/ - -// Deprecated in version 1.31 -#pragma message("Warning: this file is empty and will disappear in a future release. Do not include it.") diff --git a/ql/timeseries.hpp b/ql/timeseries.hpp index 8a0f17a5317..228c78a4f93 100644 --- a/ql/timeseries.hpp +++ b/ql/timeseries.hpp @@ -175,101 +175,6 @@ namespace QuantLib { projection_value; public: - //! \name Projection iterators - //@{ - - /*! \deprecated Use const_iterator instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use const_iterator instead and access the `first` data member.")]] - typedef boost::transform_iterator const_time_iterator; - - /*! \deprecated Use const_iterator instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use const_iterator instead and access the `second` data member.")]] - typedef boost::transform_iterator const_value_iterator; - - /*! \deprecated Use const_reverse_iterator instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use const_reverse_iterator instead and access the `first` data member.")]] - typedef boost::transform_iterator const_reverse_time_iterator; - - /*! \deprecated Use const_reverse_iterator instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use const_reverse_iterator instead and access the `second` data member.")]] - typedef boost::transform_iterator const_reverse_value_iterator; - - QL_DEPRECATED_DISABLE_WARNING - - /*! \deprecated Use cbegin instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use cbegin instead and access the `second` data member.")]] - const_value_iterator cbegin_values() const { - return const_value_iterator(cbegin(), get_value); - } - - /*! \deprecated Use cend instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use cend instead and access the `second` data member.")]] - const_value_iterator cend_values() const { - return const_value_iterator(cend(), get_value); - } - - /*! \deprecated Use crbegin instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use crbegin instead and access the `second` data member.")]] - const_reverse_value_iterator crbegin_values() const { - return const_reverse_value_iterator(crbegin(), get_value); - } - - /*! \deprecated Use crend instead and access the `second` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use crend instead and access the `second` data member.")]] - const_reverse_value_iterator crend_values() const { - return const_reverse_value_iterator(crend(), get_value); - } - - /*! \deprecated Use cbegin instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use cbegin instead and access the `first` data member.")]] - const_time_iterator cbegin_time() const { - return const_time_iterator(cbegin(), get_time); - } - - /*! \deprecated Use cend instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use cend instead and access the `first` data member.")]] - const_time_iterator cend_time() const { - return const_time_iterator(cend(), get_time); - } - - /*! \deprecated Use crbegin instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use crbegin instead and access the `first` data member.")]] - const_reverse_time_iterator crbegin_time() const { - return const_reverse_time_iterator(crbegin(), get_time); - } - - /*! \deprecated Use crend instead and access the `first` data member. - Deprecated in version 1.31. - */ - [[deprecated("Use crend instead and access the `first` data member.")]] - const_reverse_time_iterator crend_time() const { - return const_reverse_time_iterator(crend(), get_time); - } - - QL_DEPRECATED_ENABLE_WARNING - //! \name Utilities //@{ const_iterator find(const Date&); diff --git a/ql/utilities/steppingiterator.hpp b/ql/utilities/steppingiterator.hpp index 5863ac3cb4f..ae7b3e48f07 100644 --- a/ql/utilities/steppingiterator.hpp +++ b/ql/utilities/steppingiterator.hpp @@ -65,48 +65,8 @@ namespace QuantLib { ::value>* = nullptr) : base_(i.base_), step_(static_cast(i.step())) {} - // inspector Size step() const { return static_cast(this->step_); } - /*! \deprecated This class no longer inherits from boost::iterator_adaptor`. - Deprecated in version 1.31. - */ - [[deprecated("Do not use the boost::iterator_adaptor interface.")]] - Iterator base() const { return base_; } - - /*! \deprecated This class no longer inherits from boost::iterator_adaptor`. - Deprecated in version 1.31. - */ - [[deprecated("Do not use the boost::iterator_adaptor interface.")]] - void increment() { - std::advance(base_, step_); - } - - /*! \deprecated This class no longer inherits from boost::iterator_adaptor`. - Deprecated in version 1.31. - */ - [[deprecated("Do not use the boost::iterator_adaptor interface.")]] - void decrement() { - std::advance(base_, -step_); - } - - /*! \deprecated This class no longer inherits from boost::iterator_adaptor`. - Deprecated in version 1.31. - */ - [[deprecated("Do not use the boost::iterator_adaptor interface.")]] - void advance(typename std::iterator_traits::difference_type n) { - base_ += n*(this->step_); - } - - /*! \deprecated This class no longer inherits from boost::iterator_adaptor`. - Deprecated in version 1.31. - */ - [[deprecated("Do not use the boost::iterator_adaptor interface.")]] - typename std::iterator_traits::difference_type - distance_to(const step_iterator& i) const { - return (i.base_ - base_) / step_; - } - step_iterator& operator=(const step_iterator& other) { base_ = other.base_; step_ = other.step_; diff --git a/test-suite/inflation.cpp b/test-suite/inflation.cpp index 357a7e456b0..f262f1cffbd 100644 --- a/test-suite/inflation.cpp +++ b/test-suite/inflation.cpp @@ -958,138 +958,6 @@ BOOST_AUTO_TEST_CASE(testRatioYYIndex) { } } -BOOST_AUTO_TEST_CASE(testOldRatioYYIndex) { - BOOST_TEST_MESSAGE("Testing old-style ratio year-on-year inflation indices..."); - - QL_DEPRECATED_DISABLE_WARNING - - YYEUHICPr yyeuhicpr(true); - - QL_DEPRECATED_ENABLE_WARNING - - if (yyeuhicpr.name() != "EU YYR_HICP" - || yyeuhicpr.frequency() != Monthly - || yyeuhicpr.revised() - || !yyeuhicpr.interpolated() - || !yyeuhicpr.ratio() - || yyeuhicpr.availabilityLag() != 1*Months) { - BOOST_ERROR("wrong year-on-year EU HICPr data (" - << yyeuhicpr.name() << ", " - << yyeuhicpr.frequency() << ", " - << yyeuhicpr.revised() << ", " - << yyeuhicpr.interpolated() << ", " - << yyeuhicpr.ratio() << ", " - << yyeuhicpr.availabilityLag() << ")"); - } - - QL_DEPRECATED_DISABLE_WARNING - - YYUKRPIr yyukrpir(false); - - QL_DEPRECATED_ENABLE_WARNING - - if (yyukrpir.name() != "UK YYR_RPI" - || yyukrpir.frequency() != Monthly - || yyukrpir.revised() - || yyukrpir.interpolated() - || !yyukrpir.ratio() - || yyukrpir.availabilityLag() != 1*Months) { - BOOST_ERROR("wrong year-on-year UK RPIr data (" - << yyukrpir.name() << ", " - << yyukrpir.frequency() << ", " - << yyukrpir.revised() << ", " - << yyukrpir.interpolated() << ", " - << yyukrpir.ratio() << ", " - << yyukrpir.availabilityLag() << ")"); - } - - - // Retrieval test. - //---------------- - // make sure of the evaluation date - Date evaluationDate(13, August, 2007); - evaluationDate = UnitedKingdom().adjust(evaluationDate); - Settings::instance().evaluationDate() = evaluationDate; - - // fixing data - Date from(1, January, 2005); - Date to(13, August, 2007); - Schedule rpiSchedule = MakeSchedule().from(from).to(to) - .withTenor(1*Months) - .withCalendar(UnitedKingdom()) - .withConvention(ModifiedFollowing); - - Real fixData[] = { 189.9, 189.9, 189.6, 190.5, 191.6, 192.0, - 192.2, 192.2, 192.6, 193.1, 193.3, 193.6, - 194.1, 193.4, 194.2, 195.0, 196.5, 197.7, - 198.5, 198.5, 199.2, 200.1, 200.4, 201.1, - 202.7, 201.6, 203.1, 204.4, 205.4, 206.2, - 207.3 }; - - bool interp = false; - - QL_DEPRECATED_DISABLE_WARNING - - ext::shared_ptr iir(new YYUKRPIr(interp)); - ext::shared_ptr iirYES(new YYUKRPIr(true)); - - QL_DEPRECATED_ENABLE_WARNING - - for (Size i=0; iaddFixing(rpiSchedule[i], fixData[i]); - iirYES->addFixing(rpiSchedule[i], fixData[i]); - } - - Date todayMinusLag = evaluationDate - iir->availabilityLag(); - std::pair lim = inflationPeriod(todayMinusLag, iir->frequency()); - todayMinusLag = lim.second + 1 - 2*Period(iir->frequency()); - - Real eps = 1.0e-8; - - // Interpolation tests - //-------------------- - // (no TS so can't forecast). - for (Size i=13; i lim = inflationPeriod(rpiSchedule[i], - iir->frequency()); - std::pair limBef = inflationPeriod(rpiSchedule[i-12], - iir->frequency()); - for (Date d=lim.first; d<=lim.second; d++) { - if (d < todayMinusLag) { - Rate expected = fixData[i]/fixData[i-12] - 1.0; - Rate calculated = iir->fixing(d); - BOOST_CHECK_MESSAGE(std::fabs(calculated - expected) < eps, - "Non-interpolated fixings not constant within a period: " - << calculated - << ", should be " - << expected); - - Real dp= lim.second + 1- lim.first; - Real dpBef=limBef.second + 1 - limBef.first; - Real dl = d-lim.first; - // potentially does not work on 29th Feb - Real dlBef = NullCalendar().advance(d, -1*Years, ModifiedFollowing) - -limBef.first; - - Real linearNow = fixData[i] + (fixData[i+1]-fixData[i])*dl/dp; - Real linearBef = fixData[i-12] + (fixData[i+1-12]-fixData[i-12])*dlBef/dpBef; - Rate expectedYES = linearNow / linearBef - 1.0; - Rate calculatedYES = iirYES->fixing(d); - BOOST_CHECK_MESSAGE(fabs(expectedYES-calculatedYES) expected{prices[2], prices[0], prices[1]}; BOOST_TEST(tsValues == expected); } - - // == deprecated == - QL_DEPRECATED_DISABLE_WARNING - - // accessing dates - { - std::vector tsDates; - std::copy(ts.cbegin_time(), ts.cend_time(), std::back_inserter(tsDates)); - const std::vector expected{dates[2], dates[0], dates[1]}; - BOOST_TEST(tsDates == expected); - } - - // accessing values - { - std::vector tsValues; - std::copy(ts.cbegin_values(), ts.cend_values(), std::back_inserter(tsValues)); - const std::vector expected{prices[2], prices[0], prices[1]}; - BOOST_TEST(tsValues == expected); - } - - QL_DEPRECATED_ENABLE_WARNING } BOOST_AUTO_TEST_CASE(testCustomContainer) {