From 24bbaaa53d6f5ef5ba98ee14f7bbba6c1f75a0ea Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Fri, 20 Oct 2023 11:43:50 +0200 Subject: [PATCH] Remove features deprecated in version 1.28 --- QuantLib.vcxproj | 4 - QuantLib.vcxproj.filters | 15 --- cmake/GenerateHeaders.cmake | 9 +- configure.ac | 1 - ql/CMakeLists.txt | 4 - ql/experimental/Makefile.am | 2 +- ql/experimental/all.hpp | 1 - ql/experimental/amortizingbonds/Makefile.am | 22 ---- ql/experimental/amortizingbonds/all.hpp | 4 - .../amortizingbonds/amortizingcmsratebond.hpp | 23 ---- .../amortizingfixedratebond.hpp | 23 ---- .../amortizingfloatingratebond.hpp | 23 ---- .../callablebonds/callablebond.cpp | 15 --- .../callablebonds/callablebond.hpp | 14 --- .../bonds/amortizingfixedratebond.cpp | 68 ----------- .../bonds/amortizingfixedratebond.hpp | 33 ------ ql/instruments/bonds/fixedratebond.cpp | 107 ------------------ ql/instruments/bonds/fixedratebond.hpp | 47 +------- ql/instruments/bonds/floatingratebond.cpp | 75 ------------ ql/instruments/bonds/floatingratebond.hpp | 30 ----- ql/instruments/cpicapfloor.cpp | 41 +------ ql/instruments/cpicapfloor.hpp | 49 -------- .../volatility/sabrsmilesection.cpp | 11 -- .../volatility/sabrsmilesection.hpp | 10 -- test-suite/callablebonds.cpp | 24 ---- 25 files changed, 7 insertions(+), 648 deletions(-) delete mode 100644 ql/experimental/amortizingbonds/Makefile.am delete mode 100644 ql/experimental/amortizingbonds/all.hpp delete mode 100644 ql/experimental/amortizingbonds/amortizingcmsratebond.hpp delete mode 100644 ql/experimental/amortizingbonds/amortizingfixedratebond.hpp delete mode 100644 ql/experimental/amortizingbonds/amortizingfloatingratebond.hpp diff --git a/QuantLib.vcxproj b/QuantLib.vcxproj index 718e28c69d0..eb9d2e40dfb 100644 --- a/QuantLib.vcxproj +++ b/QuantLib.vcxproj @@ -543,10 +543,6 @@ - - - - diff --git a/QuantLib.vcxproj.filters b/QuantLib.vcxproj.filters index f17803fd6e8..db249c711ff 100644 --- a/QuantLib.vcxproj.filters +++ b/QuantLib.vcxproj.filters @@ -244,9 +244,6 @@ {4eadb3fc-a4ce-4e0c-bfe5-f23777a30a8d} - - {101d6cdd-3e77-48cd-8bec-c84a252324f0} - {33f1be16-e858-4cfe-ba9c-483609826221} @@ -3606,18 +3603,6 @@ experimental\commodities - - experimental\amortizingbonds - - - experimental\amortizingbonds - - - experimental\amortizingbonds - - - experimental\amortizingbonds - experimental\averageois diff --git a/cmake/GenerateHeaders.cmake b/cmake/GenerateHeaders.cmake index d29488cedc0..b2afd0ed192 100644 --- a/cmake/GenerateHeaders.cmake +++ b/cmake/GenerateHeaders.cmake @@ -41,15 +41,8 @@ function(generate_dir_headers source_dir binary_dir) list(FILTER children_hpp EXCLUDE REGEX "swaptionvolcube2.hpp") list(FILTER children_hpp EXCLUDE REGEX "swaptionvolcube1a.hpp") - # The ql/experimental/amortizingbonds have been moved to ql/instruments/bonds + # These headers were moved to another location. # Therefore, we can ignore them as they only contain a warning and the new includes. - if (${source_dir} MATCHES "experimental" AND ${source_dir} MATCHES "amortizingbonds") - list(FILTER children_hpp EXCLUDE REGEX "amortizingfixedratebond.hpp") - list(FILTER children_hpp EXCLUDE REGEX "amortizingfloatingratebond.hpp") - list(FILTER children_hpp EXCLUDE REGEX "amortizingcmsratebond.hpp") - endif () - - # Same for some headers in experimental/exoticoptions if (${source_dir} MATCHES "experimental" AND ${source_dir} MATCHES "exoticoptions") list(FILTER children_hpp EXCLUDE REGEX "margrabeoption.hpp") list(FILTER children_hpp EXCLUDE REGEX "analyticamericanmargrabeengine.hpp") diff --git a/configure.ac b/configure.ac index 708670d194e..8d45a836b1d 100644 --- a/configure.ac +++ b/configure.ac @@ -528,7 +528,6 @@ AC_CONFIG_FILES([ ql/cashflows/Makefile ql/currencies/Makefile ql/experimental/Makefile - ql/experimental/amortizingbonds/Makefile ql/experimental/asian/Makefile ql/experimental/averageois/Makefile ql/experimental/barrieroption/Makefile diff --git a/ql/CMakeLists.txt b/ql/CMakeLists.txt index a8341f769b3..f124cb23c33 100644 --- a/ql/CMakeLists.txt +++ b/ql/CMakeLists.txt @@ -988,9 +988,6 @@ set(QL_HEADERS event.hpp exchangerate.hpp exercise.hpp - experimental/amortizingbonds/amortizingcmsratebond.hpp - experimental/amortizingbonds/amortizingfixedratebond.hpp - experimental/amortizingbonds/amortizingfloatingratebond.hpp experimental/asian/analytic_cont_geom_av_price_heston.hpp experimental/asian/analytic_discr_geom_av_price_heston.hpp experimental/averageois/arithmeticaverageois.hpp @@ -2235,7 +2232,6 @@ set(QL_GENERATED_HEADERS ${PROJECT_BINARY_DIR}/ql/cashflows/all.hpp ${PROJECT_BINARY_DIR}/ql/currencies/all.hpp ${PROJECT_BINARY_DIR}/ql/experimental/all.hpp - ${PROJECT_BINARY_DIR}/ql/experimental/amortizingbonds/all.hpp ${PROJECT_BINARY_DIR}/ql/experimental/asian/all.hpp ${PROJECT_BINARY_DIR}/ql/experimental/averageois/all.hpp ${PROJECT_BINARY_DIR}/ql/experimental/barrieroption/all.hpp diff --git a/ql/experimental/Makefile.am b/ql/experimental/Makefile.am index 00a74072a40..224d83d9c3a 100644 --- a/ql/experimental/Makefile.am +++ b/ql/experimental/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = amortizingbonds asian averageois barrieroption basismodels \ +SUBDIRS = asian averageois barrieroption basismodels \ callablebonds catbonds commodities coupons credit \ exoticoptions finitedifferences forward fx inflation lattices \ math mcbasket models processes risk shortrate swaptions \ diff --git a/ql/experimental/all.hpp b/ql/experimental/all.hpp index 2cee89b8091..d0d18f44d89 100644 --- a/ql/experimental/all.hpp +++ b/ql/experimental/all.hpp @@ -1,7 +1,6 @@ /* This file is automatically generated; do not edit. */ /* Add the files to be included into Makefile.am instead. */ -#include #include #include #include diff --git a/ql/experimental/amortizingbonds/Makefile.am b/ql/experimental/amortizingbonds/Makefile.am deleted file mode 100644 index 6038bde40bd..00000000000 --- a/ql/experimental/amortizingbonds/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ - -AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir} - -this_includedir=${includedir}/${subdir} -this_include_HEADERS = \ - all.hpp \ - amortizingcmsratebond.hpp \ - amortizingfixedratebond.hpp \ - amortizingfloatingratebond.hpp - -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 amortizingcmsratebond.hpp amortizingfixedratebond.hpp amortizingfloatingratebond.hpp, $(this_include_HEADERS)); do \ - echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \ - done - echo >> ${srcdir}/$@ - subdirs='$(SUBDIRS)'; for i in $$subdirs; do \ - echo "#include <${subdir}/$$i/all.hpp>" >> ${srcdir}/$@; \ - done - diff --git a/ql/experimental/amortizingbonds/all.hpp b/ql/experimental/amortizingbonds/all.hpp deleted file mode 100644 index e4b7634c770..00000000000 --- a/ql/experimental/amortizingbonds/all.hpp +++ /dev/null @@ -1,4 +0,0 @@ -/* This file is automatically generated; do not edit. */ -/* Add the files to be included into Makefile.am instead. */ - - diff --git a/ql/experimental/amortizingbonds/amortizingcmsratebond.hpp b/ql/experimental/amortizingbonds/amortizingcmsratebond.hpp deleted file mode 100644 index 43a67c6ad73..00000000000 --- a/ql/experimental/amortizingbonds/amortizingcmsratebond.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2008 Simon Ibbotson - - 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.28 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/amortizingbonds/amortizingfixedratebond.hpp b/ql/experimental/amortizingbonds/amortizingfixedratebond.hpp deleted file mode 100644 index 7c803eafca2..00000000000 --- a/ql/experimental/amortizingbonds/amortizingfixedratebond.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2008 Simon Ibbotson - - 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.28 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/amortizingbonds/amortizingfloatingratebond.hpp b/ql/experimental/amortizingbonds/amortizingfloatingratebond.hpp deleted file mode 100644 index bc9777c0000..00000000000 --- a/ql/experimental/amortizingbonds/amortizingfloatingratebond.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - -/* - Copyright (C) 2008 Simon Ibbotson - - 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.28 -#pragma message("Warning: this file will disappear in a future release; include instead.") - -#include diff --git a/ql/experimental/callablebonds/callablebond.cpp b/ql/experimental/callablebonds/callablebond.cpp index ec9c79c5153..2c79bd2ef31 100644 --- a/ql/experimental/callablebonds/callablebond.cpp +++ b/ql/experimental/callablebonds/callablebond.cpp @@ -138,21 +138,6 @@ namespace QuantLib { return solver.solve(f, accuracy, guess, minVol, maxVol); } - Volatility CallableBond::impliedVolatility( - Real targetValue, - const Handle& discountCurve, - Real accuracy, - Size maxEvaluations, - Volatility minVol, - Volatility maxVol) const { - QL_REQUIRE(!isExpired(), "instrument expired"); - Volatility guess = 0.5 * (minVol + maxVol); - ImpliedVolHelper f(*this, discountCurve, targetValue, true); - Brent solver; - solver.setMaxEvaluations(maxEvaluations); - return solver.solve(f, accuracy, guess, minVol, maxVol); - } - namespace { diff --git a/ql/experimental/callablebonds/callablebond.hpp b/ql/experimental/callablebonds/callablebond.hpp index 4bd35f55526..88fffdbbdab 100644 --- a/ql/experimental/callablebonds/callablebond.hpp +++ b/ql/experimental/callablebonds/callablebond.hpp @@ -79,20 +79,6 @@ namespace QuantLib { Volatility minVol, Volatility maxVol) const; - /*! \warning This version of the method takes an NPV as target, not a price. - - \deprecated Use the other overload. - Deprecated in version 1.28. - */ - QL_DEPRECATED - Volatility impliedVolatility( - Real targetValue, - const Handle& discountCurve, - Real accuracy, - Size maxEvaluations, - Volatility minVol, - Volatility maxVol) const; - //! Calculate the Option Adjusted Spread (OAS) /*! Calculates the spread that needs to be added to the reference curve so that the theoretical model value diff --git a/ql/instruments/bonds/amortizingfixedratebond.cpp b/ql/instruments/bonds/amortizingfixedratebond.cpp index 824f2ec2e40..e42d36e5dce 100644 --- a/ql/instruments/bonds/amortizingfixedratebond.cpp +++ b/ql/instruments/bonds/amortizingfixedratebond.cpp @@ -60,74 +60,6 @@ namespace QuantLib { } - AmortizingFixedRateBond::AmortizingFixedRateBond( - Natural settlementDays, - const Calendar& calendar, - Real initialFaceAmount, - const Date& startDate, - const Period& bondTenor, - const Frequency& sinkingFrequency, - const Rate coupon, - const DayCounter& accrualDayCounter, - BusinessDayConvention paymentConvention, - const Date& issueDate) - : Bond(settlementDays, calendar, issueDate), - frequency_(sinkingFrequency), - dayCounter_(accrualDayCounter) { - - QL_REQUIRE(bondTenor.length() > 0, - "bond tenor must be positive. " - << bondTenor << " is not allowed."); - maturityDate_ = startDate + bondTenor; - - cashflows_ = - FixedRateLeg(sinkingSchedule(startDate, bondTenor, - sinkingFrequency, calendar)) - .withNotionals(sinkingNotionals(bondTenor, - sinkingFrequency, coupon, - initialFaceAmount)) - .withCouponRates(coupon, accrualDayCounter) - .withPaymentAdjustment(paymentConvention); - - addRedemptionsToCashflows(); - } - - - AmortizingFixedRateBond::AmortizingFixedRateBond( - Natural settlementDays, - const std::vector& notionals, - const Schedule& schedule, - const std::vector& coupons, - BusinessDayConvention paymentConvention, - const Date& issueDate, - const Calendar& paymentCalendar, - const Period& exCouponPeriod, - const Calendar& exCouponCalendar, - const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth) - : Bond(settlementDays, - paymentCalendar==Calendar() ? schedule.calendar() : paymentCalendar, - issueDate), - frequency_(schedule.tenor().frequency()), - dayCounter_(coupons[0].dayCounter()) { - - maturityDate_ = schedule.endDate(); - - cashflows_ = FixedRateLeg(schedule) - .withNotionals(notionals) - .withCouponRates(coupons) - .withPaymentAdjustment(paymentConvention) - .withExCouponPeriod(exCouponPeriod, - exCouponCalendar, - exCouponConvention, - exCouponEndOfMonth); - - addRedemptionsToCashflows(); - - QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); - } - - Schedule sinkingSchedule(const Date& startDate, const Period& bondLength, const Frequency& frequency, diff --git a/ql/instruments/bonds/amortizingfixedratebond.hpp b/ql/instruments/bonds/amortizingfixedratebond.hpp index b966947fb1c..8f1782205e0 100644 --- a/ql/instruments/bonds/amortizingfixedratebond.hpp +++ b/ql/instruments/bonds/amortizingfixedratebond.hpp @@ -48,39 +48,6 @@ namespace QuantLib { const std::vector& redemptions = { 100.0 }, Natural paymentLag = 0); - /*! \deprecated Use the other constructor after calling sinkingSchedule - and sinkingNotionals to generate the required parameters. - Deprecated in version 1.28. - */ - QL_DEPRECATED - AmortizingFixedRateBond(Natural settlementDays, - const Calendar& calendar, - Real faceAmount, - const Date& startDate, - const Period& bondTenor, - const Frequency& sinkingFrequency, - Rate coupon, - const DayCounter& accrualDayCounter, - BusinessDayConvention paymentConvention = Following, - const Date& issueDate = Date()); - - /*! \deprecated Build a FixedRateLeg instead and use it - to create an instance of the base Bond class. - Deprecated in version 1.28. - */ - QL_DEPRECATED - AmortizingFixedRateBond(Natural settlementDays, - const std::vector& notionals, - const Schedule& schedule, - const std::vector& coupons, - BusinessDayConvention paymentConvention = Following, - const Date& issueDate = Date(), - const Calendar& paymentCalendar = Calendar(), - const Period& exCouponPeriod = Period(), - const Calendar& exCouponCalendar = Calendar(), - BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false); - Frequency frequency() const { return frequency_; } const DayCounter& dayCounter() const { return dayCounter_; } protected: diff --git a/ql/instruments/bonds/fixedratebond.cpp b/ql/instruments/bonds/fixedratebond.cpp index 26fd3a15fe9..6fe103786d6 100644 --- a/ql/instruments/bonds/fixedratebond.cpp +++ b/ql/instruments/bonds/fixedratebond.cpp @@ -68,111 +68,4 @@ namespace QuantLib { QL_ENSURE(redemptions_.size() == 1, "multiple redemptions created"); } - FixedRateBond::FixedRateBond(Natural settlementDays, - const Calendar& calendar, - Real faceAmount, - const Date& startDate, - const Date& maturityDate, - const Period& tenor, - const std::vector& coupons, - const DayCounter& accrualDayCounter, - BusinessDayConvention accrualConvention, - BusinessDayConvention paymentConvention, - Real redemption, - const Date& issueDate, - const Date& stubDate, - DateGeneration::Rule rule, - bool endOfMonth, - const Calendar& paymentCalendar, - const Period& exCouponPeriod, - const Calendar& exCouponCalendar, - const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth, - const DayCounter& firstPeriodDayCounter) - : Bond(settlementDays, - paymentCalendar==Calendar() ? calendar : paymentCalendar, - issueDate), - frequency_(tenor.frequency()), dayCounter_(accrualDayCounter), - firstPeriodDayCounter_(firstPeriodDayCounter) { - - maturityDate_ = maturityDate; - - Date firstDate, nextToLastDate; - switch (rule) { - case DateGeneration::Backward: - firstDate = Date(); - nextToLastDate = stubDate; - break; - case DateGeneration::Forward: - firstDate = stubDate; - nextToLastDate = Date(); - break; - case DateGeneration::Zero: - case DateGeneration::ThirdWednesday: - case DateGeneration::Twentieth: - case DateGeneration::TwentiethIMM: - QL_FAIL("stub date (" << stubDate << ") not allowed with " << - rule << " DateGeneration::Rule"); - default: - QL_FAIL("unknown DateGeneration::Rule (" << Integer(rule) << ")"); - } - - Schedule schedule(startDate, maturityDate_, tenor, - calendar, accrualConvention, accrualConvention, - rule, endOfMonth, - firstDate, nextToLastDate); - - cashflows_ = FixedRateLeg(schedule) - .withNotionals(faceAmount) - .withCouponRates(coupons, accrualDayCounter) - .withFirstPeriodDayCounter(firstPeriodDayCounter) - .withPaymentCalendar(calendar_) - .withPaymentAdjustment(paymentConvention) - .withExCouponPeriod(exCouponPeriod, - exCouponCalendar, - exCouponConvention, - exCouponEndOfMonth); - - addRedemptionsToCashflows(std::vector(1, redemption)); - - QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); - QL_ENSURE(redemptions_.size() == 1, "multiple redemptions created"); - } - - FixedRateBond::FixedRateBond(Natural settlementDays, - Real faceAmount, - const Schedule& schedule, - const std::vector& coupons, - BusinessDayConvention paymentConvention, - Real redemption, - const Date& issueDate, - const Calendar& paymentCalendar, - const Period& exCouponPeriod, - const Calendar& exCouponCalendar, - const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth) - : Bond(settlementDays, - paymentCalendar==Calendar() ? schedule.calendar() : paymentCalendar, - issueDate), - frequency_(schedule.tenor().frequency()), - dayCounter_(coupons[0].dayCounter()) { - - maturityDate_ = schedule.endDate(); - - cashflows_ = FixedRateLeg(schedule) - .withNotionals(faceAmount) - .withCouponRates(coupons) - .withPaymentCalendar(calendar_) - .withPaymentAdjustment(paymentConvention) - .withExCouponPeriod(exCouponPeriod, - exCouponCalendar, - exCouponConvention, - exCouponEndOfMonth); - - addRedemptionsToCashflows(std::vector(1, redemption)); - - QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); - QL_ENSURE(redemptions_.size() == 1, "multiple redemptions created"); - } - } diff --git a/ql/instruments/bonds/fixedratebond.hpp b/ql/instruments/bonds/fixedratebond.hpp index 569f8eec093..20a8dec9f4a 100644 --- a/ql/instruments/bonds/fixedratebond.hpp +++ b/ql/instruments/bonds/fixedratebond.hpp @@ -61,52 +61,9 @@ namespace QuantLib { bool exCouponEndOfMonth = false, const DayCounter& firstPeriodDayCounter = DayCounter()); - /*! \deprecated Use the constructor taking a schedule. - Deprecated in version 1.28. - */ - QL_DEPRECATED - FixedRateBond(Natural settlementDays, - const Calendar& couponCalendar, - Real faceAmount, - const Date& startDate, - const Date& maturityDate, - const Period& tenor, - const std::vector& coupons, - const DayCounter& accrualDayCounter, - BusinessDayConvention accrualConvention = Following, - BusinessDayConvention paymentConvention = Following, - Real redemption = 100.0, - const Date& issueDate = Date(), - const Date& stubDate = Date(), - DateGeneration::Rule rule = DateGeneration::Backward, - bool endOfMonth = false, - const Calendar& paymentCalendar = Calendar(), - const Period& exCouponPeriod = Period(), - const Calendar& exCouponCalendar = Calendar(), - BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false, - const DayCounter& firstPeriodDayCounter = DayCounter()); - - /*! \deprecated Build a FixedRateLeg instead and use it - to create an instance of the base Bond class. - Deprecated in version 1.28. - */ - QL_DEPRECATED - FixedRateBond(Natural settlementDays, - Real faceAmount, - const Schedule& schedule, - const std::vector& coupons, - BusinessDayConvention paymentConvention = Following, - Real redemption = 100.0, - const Date& issueDate = Date(), - const Calendar& paymentCalendar = Calendar(), - const Period& exCouponPeriod = Period(), - const Calendar& exCouponCalendar = Calendar(), - BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false); Frequency frequency() const { return frequency_; } - const DayCounter& dayCounter() const {return dayCounter_;} - const DayCounter& firstPeriodDayCounter() const {return firstPeriodDayCounter_;} + const DayCounter& dayCounter() const { return dayCounter_; } + const DayCounter& firstPeriodDayCounter() const { return firstPeriodDayCounter_; } protected: Frequency frequency_; DayCounter dayCounter_; diff --git a/ql/instruments/bonds/floatingratebond.cpp b/ql/instruments/bonds/floatingratebond.cpp index 625c24725c6..eee8fd32858 100644 --- a/ql/instruments/bonds/floatingratebond.cpp +++ b/ql/instruments/bonds/floatingratebond.cpp @@ -70,79 +70,4 @@ namespace QuantLib { registerWith(iborIndex); } - FloatingRateBond::FloatingRateBond( - Natural settlementDays, - Real faceAmount, - const Date& startDate, - const Date& maturityDate, - Frequency couponFrequency, - const Calendar& calendar, - const ext::shared_ptr& iborIndex, - const DayCounter& accrualDayCounter, - BusinessDayConvention accrualConvention, - BusinessDayConvention paymentConvention, - Natural fixingDays, - const std::vector& gearings, - const std::vector& spreads, - const std::vector& caps, - const std::vector& floors, - bool inArrears, - Real redemption, - const Date& issueDate, - const Date& stubDate, - DateGeneration::Rule rule, - bool endOfMonth, - const Period& exCouponPeriod, - const Calendar& exCouponCalendar, - const BusinessDayConvention exCouponConvention, - bool exCouponEndOfMonth) - : Bond(settlementDays, calendar, issueDate) { - - maturityDate_ = maturityDate; - - Date firstDate, nextToLastDate; - switch (rule) { - case DateGeneration::Backward: - firstDate = Date(); - nextToLastDate = stubDate; - break; - case DateGeneration::Forward: - firstDate = stubDate; - nextToLastDate = Date(); - break; - case DateGeneration::Zero: - case DateGeneration::ThirdWednesday: - case DateGeneration::Twentieth: - case DateGeneration::TwentiethIMM: - QL_FAIL("stub date (" << stubDate << ") not allowed with " << - rule << " DateGeneration::Rule"); - default: - QL_FAIL("unknown DateGeneration::Rule (" << Integer(rule) << ")"); - } - - Schedule schedule(startDate, maturityDate_, Period(couponFrequency), - calendar_, accrualConvention, accrualConvention, - rule, endOfMonth, - firstDate, nextToLastDate); - - cashflows_ = IborLeg(schedule, iborIndex) - .withNotionals(faceAmount) - .withPaymentDayCounter(accrualDayCounter) - .withPaymentAdjustment(paymentConvention) - .withFixingDays(fixingDays) - .withGearings(gearings) - .withSpreads(spreads) - .withCaps(caps) - .withFloors(floors) - .inArrears(inArrears) - .withExCouponPeriod(exCouponPeriod,exCouponCalendar, exCouponConvention, exCouponEndOfMonth); - - addRedemptionsToCashflows(std::vector(1, redemption)); - - QL_ENSURE(!cashflows().empty(), "bond with no cashflows!"); - QL_ENSURE(redemptions_.size() == 1, "multiple redemptions created"); - - registerWith(iborIndex); - } - } diff --git a/ql/instruments/bonds/floatingratebond.hpp b/ql/instruments/bonds/floatingratebond.hpp index 1f10cb0e7b4..4e78b8719bc 100644 --- a/ql/instruments/bonds/floatingratebond.hpp +++ b/ql/instruments/bonds/floatingratebond.hpp @@ -59,36 +59,6 @@ namespace QuantLib { const Calendar& exCouponCalendar = Calendar(), BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false); - - /*! \deprecated Use the other constructor. - Deprecated in version 1.28. - */ - QL_DEPRECATED - FloatingRateBond(Natural settlementDays, - Real faceAmount, - const Date& startDate, - const Date& maturityDate, - Frequency couponFrequency, - const Calendar& calendar, - const ext::shared_ptr& iborIndex, - const DayCounter& accrualDayCounter, - BusinessDayConvention accrualConvention = Following, - BusinessDayConvention paymentConvention = Following, - Natural fixingDays = Null(), - const std::vector& gearings = { 1.0 }, - const std::vector& spreads = { 0.0 }, - const std::vector& caps = {}, - const std::vector& floors = {}, - bool inArrears = false, - Real redemption = 100.0, - const Date& issueDate = Date(), - const Date& stubDate = Date(), - DateGeneration::Rule rule = DateGeneration::Backward, - bool endOfMonth = false, - const Period& exCouponPeriod = Period(), - const Calendar& exCouponCalendar = Calendar(), - BusinessDayConvention exCouponConvention = Unadjusted, - bool exCouponEndOfMonth = false); }; } diff --git a/ql/instruments/cpicapfloor.cpp b/ql/instruments/cpicapfloor.cpp index 11c0f820f23..d22f490892a 100644 --- a/ql/instruments/cpicapfloor.cpp +++ b/ql/instruments/cpicapfloor.cpp @@ -34,35 +34,6 @@ namespace QuantLib { - QL_DEPRECATED_DISABLE_WARNING - - CPICapFloor::CPICapFloor(Option::Type type, - Real nominal, - const Date& startDate, // start date of contract (only) - Real baseCPI, - const Date& maturity, // this is pre-adjustment! - Calendar fixCalendar, - BusinessDayConvention fixConvention, - Calendar payCalendar, - BusinessDayConvention payConvention, - Rate strike, - const ext::shared_ptr& infIndex, - const Period& observationLag, - CPI::InterpolationType observationInterpolation) - : CPICapFloor(type, - nominal, - startDate, - baseCPI, - maturity, - std::move(fixCalendar), - fixConvention, - std::move(payCalendar), - payConvention, - strike, - Handle(infIndex), - observationLag, - observationInterpolation) {} - CPICapFloor::CPICapFloor(Option::Type type, Real nominal, const Date& startDate, // start date of contract (only) @@ -73,14 +44,14 @@ namespace QuantLib { Calendar payCalendar, BusinessDayConvention payConvention, Rate strike, - const Handle& infIndex, + const ext::shared_ptr& index, const Period& observationLag, CPI::InterpolationType observationInterpolation) : type_(type), nominal_(nominal), startDate_(startDate), baseCPI_(baseCPI), maturity_(maturity), fixCalendar_(std::move(fixCalendar)), fixConvention_(fixConvention), payCalendar_(std::move(payCalendar)), payConvention_(payConvention), strike_(strike), - index_(*infIndex), observationLag_(observationLag), - observationInterpolation_(observationInterpolation), infIndex_(infIndex) { + index_(index), observationLag_(observationLag), + observationInterpolation_(observationInterpolation) { QL_REQUIRE(index_, "no inflation index passed"); QL_REQUIRE(fixCalendar_ != Calendar(), "no fixing calendar passed"); QL_REQUIRE(payCalendar_ != Calendar(), "no payment calendar passed"); @@ -98,8 +69,6 @@ namespace QuantLib { } } - QL_DEPRECATED_ENABLE_WARNING - // when you fix - but remember that there is an observation interpolation factor as well Date CPICapFloor::fixingDate() const { @@ -144,10 +113,6 @@ namespace QuantLib { arguments->index = index_; arguments->observationLag = observationLag_; arguments->observationInterpolation = observationInterpolation_; - - QL_DEPRECATED_DISABLE_WARNING - arguments->infIndex = infIndex_; - QL_DEPRECATED_ENABLE_WARNING } } diff --git a/ql/instruments/cpicapfloor.hpp b/ql/instruments/cpicapfloor.hpp index a48df801f50..a697f196bd2 100644 --- a/ql/instruments/cpicapfloor.hpp +++ b/ql/instruments/cpicapfloor.hpp @@ -78,28 +78,6 @@ namespace QuantLib { const Period& observationLag, CPI::InterpolationType observationInterpolation = CPI::AsIndex); - /*! \deprecated Use the other constructor. - Deprecated in version 1.28. - */ - QL_DEPRECATED - CPICapFloor(Option::Type type, - Real nominal, - const Date& startDate, // start date of contract (only) - Real baseCPI, - const Date& maturity, // this is pre-adjustment! - Calendar fixCalendar, - BusinessDayConvention fixConvention, - Calendar payCalendar, - BusinessDayConvention payConvention, - Rate strike, - const Handle& infIndex, - const Period& observationLag, - CPI::InterpolationType observationInterpolation = CPI::AsIndex); - - QL_DEPRECATED_DISABLE_WARNING - ~CPICapFloor() override = default; - QL_DEPRECATED_ENABLE_WARNING - //! \name Inspectors //@{ Option::Type type() const { return type_; } @@ -112,16 +90,6 @@ namespace QuantLib { Period observationLag() const { return observationLag_; } //@} - /*! \deprecated Use the `index` method instead. - Deprecated in version 1.28. - */ - QL_DEPRECATED - Handle inflationIndex() const { - QL_DEPRECATED_DISABLE_WARNING - return infIndex_; - QL_DEPRECATED_ENABLE_WARNING - } - //! \name Instrument interface //@{ bool isExpired() const override; @@ -142,22 +110,11 @@ namespace QuantLib { ext::shared_ptr index_; Period observationLag_; CPI::InterpolationType observationInterpolation_; - - /*! \deprecated Use the `index_` data member instead. - Deprecated in version 1.28. - */ - QL_DEPRECATED - Handle infIndex_; }; class CPICapFloor::arguments : public virtual PricingEngine::arguments { public: - QL_DEPRECATED_DISABLE_WARNING - arguments() = default; - ~arguments() override = default; - QL_DEPRECATED_ENABLE_WARNING - Option::Type type; Real nominal; Date startDate, fixDate, payDate; @@ -170,12 +127,6 @@ namespace QuantLib { Period observationLag; CPI::InterpolationType observationInterpolation; - /*! \deprecated Use the `index` data member instead. - Deprecated in version 1.28. - */ - QL_DEPRECATED - Handle infIndex; - void validate() const override; }; diff --git a/ql/termstructures/volatility/sabrsmilesection.cpp b/ql/termstructures/volatility/sabrsmilesection.cpp index 596d895748d..f1bbe51b4eb 100644 --- a/ql/termstructures/volatility/sabrsmilesection.cpp +++ b/ql/termstructures/volatility/sabrsmilesection.cpp @@ -35,17 +35,6 @@ namespace QuantLib { initialise(sabrParams); } - SabrSmileSection::SabrSmileSection(const Date& d, - Rate forward, - const std::vector& sabrParams, - const DayCounter& dc, - const Real shift, - VolatilityType volatilityType) - : SmileSection(d, dc, Date(), volatilityType, shift), - forward_(forward), shift_(shift) { - initialise(sabrParams); - } - SabrSmileSection::SabrSmileSection(const Date& d, Rate forward, const std::vector& sabrParams, diff --git a/ql/termstructures/volatility/sabrsmilesection.hpp b/ql/termstructures/volatility/sabrsmilesection.hpp index 3c92734d962..76a40b079b4 100644 --- a/ql/termstructures/volatility/sabrsmilesection.hpp +++ b/ql/termstructures/volatility/sabrsmilesection.hpp @@ -45,16 +45,6 @@ namespace QuantLib { const DayCounter& dc = Actual365Fixed(), Real shift = 0.0, VolatilityType volatilityType = VolatilityType::ShiftedLognormal); - /*! \deprecated Use the constructor taking an optional reference date. - Deprecated in version 1.28. - */ - QL_DEPRECATED - SabrSmileSection(const Date& d, - Rate forward, - const std::vector& sabrParameters, - const DayCounter& dc, - Real shift = 0.0, - VolatilityType volatilityType = VolatilityType::ShiftedLognormal); Real minStrike() const override { return -shift_; } Real maxStrike() const override { return QL_MAX_REAL; } diff --git a/test-suite/callablebonds.cpp b/test-suite/callablebonds.cpp index 103e07da008..31efefd7a73 100644 --- a/test-suite/callablebonds.cpp +++ b/test-suite/callablebonds.cpp @@ -781,30 +781,6 @@ void CallableBondTest::testImpliedVol() { << " calculated price: " << bond.cleanPrice() << "\n" << " expected: " << targetPrice.amount() << "\n" << " difference: " << bond.cleanPrice() - targetPrice.amount()); - - - QL_DEPRECATED_DISABLE_WARNING - - Real targetNPV = 7850.0; - volatility = bond.impliedVolatility(targetNPV, - vars.termStructure, - 1e-8, // accuracy - 200, // max evaluations - 1e-4, // min vol - 1.0); // max vol - - QL_DEPRECATED_ENABLE_WARNING - - bond.setPricingEngine(ext::make_shared( - Handle(ext::make_shared(volatility)), vars.termStructure)); - - if (std::fabs(bond.NPV() - targetNPV) > 1.0e-4) - BOOST_ERROR( - "failed to reproduce target NPV with implied volatility:\n" - << std::setprecision(5) - << " calculated NPV: " << bond.NPV() << "\n" - << " expected: " << targetNPV << "\n" - << " difference: " << bond.NPV() - targetNPV); } void CallableBondTest::testCallableFixedRateBondWithArbitrarySchedule() {