From db264185bc7611f0873c60ed7537dff551ddda51 Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Wed, 14 Jul 2021 18:01:19 +0200 Subject: [PATCH] Remove features deprecated in version 1.19. --- ql/cashflows/inflationcouponpricer.hpp | 12 -- ql/indexes/bmaindex.cpp | 12 -- ql/indexes/bmaindex.hpp | 6 - .../finitedifferences/americancondition.hpp | 17 --- ql/methods/finitedifferences/fdtypedefs.hpp | 10 -- .../finitedifferences/shoutcondition.hpp | 21 --- .../finitedifferences/stepcondition.hpp | 81 ----------- ql/models/calibrationhelper.hpp | 17 --- .../interpolatedyoyinflationcurve.hpp | 105 -------------- .../interpolatedzeroinflationcurve.hpp | 110 --------------- .../inflation/piecewiseyoyinflationcurve.hpp | 25 ---- .../inflation/piecewisezeroinflationcurve.hpp | 25 ---- ql/termstructures/inflationtermstructure.cpp | 132 ------------------ ql/termstructures/inflationtermstructure.hpp | 130 ----------------- ql/termstructures/yield/discountcurve.hpp | 24 ---- ql/termstructures/yield/forwardcurve.hpp | 24 ---- ql/termstructures/yield/forwardstructure.cpp | 10 -- ql/termstructures/yield/forwardstructure.hpp | 10 -- .../yield/interpolatedsimplezerocurve.hpp | 20 --- ql/termstructures/yield/zerocurve.hpp | 24 ---- .../yield/zeroyieldstructure.cpp | 10 -- .../yield/zeroyieldstructure.hpp | 10 -- ql/termstructures/yieldtermstructure.cpp | 10 -- ql/termstructures/yieldtermstructure.hpp | 9 -- 24 files changed, 854 deletions(-) diff --git a/ql/cashflows/inflationcouponpricer.hpp b/ql/cashflows/inflationcouponpricer.hpp index 9c193c424d0..2213b1874f5 100644 --- a/ql/cashflows/inflationcouponpricer.hpp +++ b/ql/cashflows/inflationcouponpricer.hpp @@ -143,10 +143,6 @@ namespace QuantLib { //! Black-formula pricer for capped/floored yoy inflation coupons class BlackYoYInflationCouponPricer : public YoYInflationCouponPricer { public: - /*! \deprecated Use one of the other constructors. - Deprecated in version 1.19. - */ - QL_DEPRECATED BlackYoYInflationCouponPricer() : YoYInflationCouponPricer(Handle(), Handle()) {} @@ -167,10 +163,6 @@ namespace QuantLib { //! Unit-Displaced-Black-formula pricer for capped/floored yoy inflation coupons class UnitDisplacedBlackYoYInflationCouponPricer : public YoYInflationCouponPricer { public: - /*! \deprecated Use one of the other constructors. - Deprecated in version 1.19. - */ - QL_DEPRECATED UnitDisplacedBlackYoYInflationCouponPricer() : YoYInflationCouponPricer(Handle(), Handle()) {} @@ -191,10 +183,6 @@ namespace QuantLib { //! Bachelier-formula pricer for capped/floored yoy inflation coupons class BachelierYoYInflationCouponPricer : public YoYInflationCouponPricer { public: - /*! \deprecated Use one of the other constructors. - Deprecated in version 1.19. - */ - QL_DEPRECATED BachelierYoYInflationCouponPricer() : YoYInflationCouponPricer(Handle(), Handle()) {} diff --git a/ql/indexes/bmaindex.cpp b/ql/indexes/bmaindex.cpp index b1eb1d3923e..739538ec332 100644 --- a/ql/indexes/bmaindex.cpp +++ b/ql/indexes/bmaindex.cpp @@ -51,18 +51,6 @@ namespace QuantLib { registerWith (h); } - BMAIndex::BMAIndex(const Handle& h, - const Calendar& fixingCalendar) - : InterestRateIndex("BMA", - 1 * Weeks, - 1, - USDCurrency(), - fixingCalendar, - ActualActual(ActualActual::ISDA)), - termStructure_(h) { - registerWith (h); - } - bool BMAIndex::isValidFixingDate(const Date& date) const { Calendar cal = fixingCalendar(); // either the fixing date is last Wednesday, or all days diff --git a/ql/indexes/bmaindex.hpp b/ql/indexes/bmaindex.hpp index 8185583def0..1685d6fbba2 100644 --- a/ql/indexes/bmaindex.hpp +++ b/ql/indexes/bmaindex.hpp @@ -41,12 +41,6 @@ namespace QuantLib { public: explicit BMAIndex(const Handle& h = Handle()); - /*! \deprecated Use the other constructor instead. - Deprecated in version 1.19. - */ - QL_DEPRECATED - BMAIndex(const Handle& h, - const Calendar& fixingCalendar); //! \name Index interface //@{ /*! BMA is fixed weekly on Wednesdays. diff --git a/ql/methods/finitedifferences/americancondition.hpp b/ql/methods/finitedifferences/americancondition.hpp index c3ae2853afb..a83f69bbd36 100644 --- a/ql/methods/finitedifferences/americancondition.hpp +++ b/ql/methods/finitedifferences/americancondition.hpp @@ -41,14 +41,6 @@ namespace QuantLib { explicit AmericanCondition(const Array& intrinsicValues) : impl_(new ArrayImpl(intrinsicValues)) {} - /*! \deprecated Use the other constructor. - Deprecated in version 1.19. - */ - QL_DEPRECATED - AmericanCondition(Option::Type type, - Real strike) - : impl_(new PayoffImpl(type, strike)) {} - void applyTo(Array& a, Time) const override { //#pragma omp parallel for for (Size i = 0; i < a.size(); i++) { @@ -79,15 +71,6 @@ namespace QuantLib { Real getValue(const Array&, int i) override { return intrinsicValues_[i]; } }; - - class PayoffImpl : public Impl { - private: - ext::shared_ptr payoff_; - public: - PayoffImpl(Option::Type type, Real strike) - : payoff_(new PlainVanillaPayoff(type, strike)) {}; - Real getValue(const Array& a, int i) override { return (*payoff_)(std::exp(a[i])); } - }; }; } diff --git a/ql/methods/finitedifferences/fdtypedefs.hpp b/ql/methods/finitedifferences/fdtypedefs.hpp index dc05b6d3510..0699a3dbfe6 100644 --- a/ql/methods/finitedifferences/fdtypedefs.hpp +++ b/ql/methods/finitedifferences/fdtypedefs.hpp @@ -42,16 +42,6 @@ namespace QuantLib { //! default choice for step condition typedef StepCondition StandardStepCondition; - QL_DEPRECATED_DISABLE_WARNING - - /*! \deprecated Inherit from StandardStepCondition directly. - Deprecated in version 1.19. - */ - QL_DEPRECATED - typedef CurveDependentStepCondition StandardCurveDependentStepCondition; - - QL_DEPRECATED_ENABLE_WARNING - } diff --git a/ql/methods/finitedifferences/shoutcondition.hpp b/ql/methods/finitedifferences/shoutcondition.hpp index 3cfe888eb25..181988d5fb2 100644 --- a/ql/methods/finitedifferences/shoutcondition.hpp +++ b/ql/methods/finitedifferences/shoutcondition.hpp @@ -46,17 +46,6 @@ namespace QuantLib { : resTime_(resTime), rate_(rate), impl_(new ArrayImpl(intrinsicValues)) {} - /*! \deprecated Use the other constructor. - Deprecated in version 1.19. - */ - QL_DEPRECATED - ShoutCondition(Option::Type type, - Real strike, - Time resTime, - Rate rate) - : resTime_(resTime), rate_(rate), - impl_(new PayoffImpl(type, strike)) {} - void applyTo(Array& a, Time t) const override { DiscountFactor B = std::exp(-rate_ * (t - resTime_)); //#pragma omp parallel for @@ -91,16 +80,6 @@ namespace QuantLib { Real getValue(const Array&, int i) override { return intrinsicValues_[i]; } }; - - class PayoffImpl : public Impl { - private: - ext::shared_ptr payoff_; - public: - PayoffImpl(Option::Type type, Real strike) - : payoff_(new PlainVanillaPayoff(type, strike)) {}; - - Real getValue(const Array& a, int i) override { return (*payoff_)(std::exp(a[i])); } - }; }; } diff --git a/ql/methods/finitedifferences/stepcondition.hpp b/ql/methods/finitedifferences/stepcondition.hpp index a849f5d460e..9f63f310a65 100644 --- a/ql/methods/finitedifferences/stepcondition.hpp +++ b/ql/methods/finitedifferences/stepcondition.hpp @@ -38,87 +38,6 @@ namespace QuantLib { virtual void applyTo(array_type& a, Time t) const = 0; }; - /* */ - /*! Abstract base class which allows step conditions to use both - payoff and array functions. - - \deprecated Inherit from StepCondition directly instead. - Deprecated in version 1.19. - */ - template - class QL_DEPRECATED CurveDependentStepCondition : - public StepCondition { - public: - void applyTo(Array &a, Time) const { - //#pragma omp parallel for - for (Size i = 0; i < a.size(); i++) { - a[i] = - applyToValue(a[i], getValue(a,i)); - } - } - protected: - -#if defined(QL_PATCH_MSVC) -#pragma warning(push) -#pragma warning(disable:4996) -#endif - - CurveDependentStepCondition(Option::Type type, Real strike) - : curveItem_(new PayoffWrapper(type, strike)) {}; - CurveDependentStepCondition(const Payoff *p) - : curveItem_(new PayoffWrapper(p)) {}; - CurveDependentStepCondition(const array_type & a) - : curveItem_(new ArrayWrapper(a)) {}; - -#if defined(QL_PATCH_MSVC) -#pragma warning(pop) -#endif - - class CurveWrapper; - - ext::shared_ptr curveItem_; - Real getValue(const array_type &a, Size index) const { - return curveItem_->getValue(a, index); - } - - virtual Real applyToValue(Real, Real) const { - QL_FAIL("not yet implemented"); - } - - class CurveWrapper { - public: - virtual ~CurveWrapper() = default; - virtual Real getValue(const array_type &a, - int i) = 0; - }; - - class ArrayWrapper : public CurveWrapper { - private: - array_type value_; - public: - ArrayWrapper (const array_type &a) - : value_(a) {} - - Real getValue(const array_type&, int i) { - return value_[i]; - } - }; - - class PayoffWrapper : public CurveWrapper { - private: - ext::shared_ptr payoff_; - public: - PayoffWrapper (const Payoff * p) - : payoff_(p) {}; - PayoffWrapper (Option::Type type, Real strike) - : payoff_(new PlainVanillaPayoff(type, strike)) {}; - Real getValue(const array_type &a, - int i) { - return (*payoff_)(a[i]); - } - }; - }; - //! %null step condition /*! \ingroup findiff */ diff --git a/ql/models/calibrationhelper.hpp b/ql/models/calibrationhelper.hpp index d609614d404..b085236441f 100644 --- a/ql/models/calibrationhelper.hpp +++ b/ql/models/calibrationhelper.hpp @@ -58,23 +58,6 @@ namespace QuantLib { registerWith(volatility_); } - /*! \deprecated Use the other constructor. It you're - inheriting from BlackCalibrationHelper, move - `termStructure_` to your derived class. - Deprecated in version 1.19. - */ - QL_DEPRECATED - BlackCalibrationHelper(Handle volatility, - Handle termStructure, - CalibrationErrorType calibrationErrorType = RelativePriceError, - const VolatilityType type = ShiftedLognormal, - const Real shift = 0.0) - : volatility_(std::move(volatility)), termStructure_(std::move(termStructure)), - volatilityType_(type), shift_(shift), calibrationErrorType_(calibrationErrorType) { - registerWith(volatility_); - registerWith(termStructure_); - } - void performCalculations() const override { marketValue_ = blackPrice(volatility_->value()); } diff --git a/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp b/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp index 97b0a9ef4fa..c12dcbb9be6 100644 --- a/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp +++ b/ql/termstructures/inflation/interpolatedyoyinflationcurve.hpp @@ -54,22 +54,6 @@ namespace QuantLib { const std::vector& rates, const Interpolator& interpolator = Interpolator()); - /*! \deprecated Use the constructor not taking a yield - term structure. - Deprecated in version 1.19. - */ - QL_DEPRECATED - InterpolatedYoYInflationCurve(const Date& referenceDate, - const Calendar& calendar, - const DayCounter& dayCounter, - const Period& lag, - Frequency frequency, - bool indexIsInterpolated, - const Handle& yTS, - std::vector dates, - const std::vector& rates, - const Interpolator& interpolator = Interpolator()); - //! \name InflationTermStructure interface //@{ Date baseDate() const override; @@ -105,22 +89,6 @@ namespace QuantLib { bool indexIsInterpolated, const Interpolator& interpolator = Interpolator()); - - /*! \deprecated Use the constructor not taking a yield - term structure. - Deprecated in version 1.19. - */ - QL_DEPRECATED - InterpolatedYoYInflationCurve(const Date& referenceDate, - const Calendar& calendar, - const DayCounter& dayCounter, - Rate baseYoYRate, - const Period& lag, - Frequency frequency, - bool indexIsInterpolated, - const Handle& yTS, - const Interpolator& interpolator - = Interpolator()); }; typedef InterpolatedYoYInflationCurve YoYInflationCurve; @@ -186,64 +154,6 @@ namespace QuantLib { this->interpolation_.update(); } - template - InterpolatedYoYInflationCurve::InterpolatedYoYInflationCurve( - const Date& referenceDate, - const Calendar& calendar, - const DayCounter& dayCounter, - const Period& lag, - Frequency frequency, - bool indexIsInterpolated, - const Handle& yTS, - std::vector dates, - const std::vector& rates, - const Interpolator& interpolator) - : YoYInflationTermStructure( - referenceDate, calendar, dayCounter, rates[0], lag, frequency, indexIsInterpolated, yTS), - InterpolatedCurve(std::vector