Skip to content

Commit

Permalink
Remove features deprecated in version 1.24 (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Oct 25, 2022
2 parents a9fa1ef + 5a8b7f8 commit b942a80
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 658 deletions.
1 change: 0 additions & 1 deletion QuantLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,6 @@
<ClCompile Include="ql\experimental\credit\recoveryratequote.cpp" />
<ClCompile Include="ql\experimental\credit\riskyassetswap.cpp" />
<ClCompile Include="ql\experimental\credit\riskyassetswapoption.cpp" />
<ClCompile Include="ql\experimental\credit\riskybond.cpp" />
<ClCompile Include="ql\experimental\credit\syntheticcdo.cpp" />
<ClCompile Include="ql\experimental\exoticoptions\analyticamericanmargrabeengine.cpp" />
<ClCompile Include="ql\experimental\exoticoptions\analyticcomplexchooserengine.cpp" />
Expand Down
11 changes: 6 additions & 5 deletions QuantLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -4403,7 +4403,9 @@
<ClInclude Include="ql\instruments\zerocouponswap.hpp">
<Filter>instruments</Filter>
</ClInclude>
<ClInclude Include="ql\pricingengines\bond\riskybondengine.hpp" />
<ClInclude Include="ql\pricingengines\bond\riskybondengine.hpp">
<Filter>pricingengines\bond</Filter>
</ClInclude>
<ClInclude Include="ql\pricingengines\asian\turnbullwakemanasianengine.hpp">
<Filter>pricingengines\asian</Filter>
</ClInclude>
Expand Down Expand Up @@ -6329,9 +6331,6 @@
<ClCompile Include="ql\experimental\credit\riskyassetswapoption.cpp">
<Filter>experimental\credit</Filter>
</ClCompile>
<ClCompile Include="ql\experimental\credit\riskybond.cpp">
<Filter>experimental\credit</Filter>
</ClCompile>
<ClCompile Include="ql\experimental\credit\syntheticcdo.cpp">
<Filter>experimental\credit</Filter>
</ClCompile>
Expand Down Expand Up @@ -7118,7 +7117,9 @@
<ClCompile Include="ql\instruments\zerocouponswap.cpp">
<Filter>instruments</Filter>
</ClCompile>
<ClCompile Include="ql\pricingengines\bond\riskybondengine.cpp" />
<ClCompile Include="ql\pricingengines\bond\riskybondengine.cpp">
<Filter>pricingengines\bond</Filter>
</ClCompile>
<ClCompile Include="ql\pricingengines\asian\turnbullwakemanasianengine.cpp">
<Filter>pricingengines\asian</Filter>
</ClCompile>
Expand Down
1 change: 0 additions & 1 deletion ql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ set(QL_SOURCES
experimental/credit/recoveryratequote.cpp
experimental/credit/riskyassetswap.cpp
experimental/credit/riskyassetswapoption.cpp
experimental/credit/riskybond.cpp
experimental/credit/syntheticcdo.cpp
experimental/exoticoptions/analyticamericanmargrabeengine.cpp
experimental/exoticoptions/analyticcomplexchooserengine.cpp
Expand Down
15 changes: 3 additions & 12 deletions ql/cashflows/cpicouponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,16 @@ namespace QuantLib {
spread_ = coupon_->spread();
paymentDate_ = coupon_->date();

QL_DEPRECATED_DISABLE_WARNING
rateCurve_ =
!nominalTermStructure_.empty() ?
nominalTermStructure_ :
ext::dynamic_pointer_cast<ZeroInflationIndex>(coupon.index())
->zeroInflationTermStructure()
->nominalTermStructure();
QL_DEPRECATED_ENABLE_WARNING

// past or future fixing is managed in YoYInflationIndex::fixing()
// use yield curve from index (which sets discount)

discount_ = 1.0;
if (rateCurve_.empty()) {
if (nominalTermStructure_.empty()) {
// allow to extract rates, but mark the discount as invalid for prices
discount_ = Null<Real>();
} else {
if (paymentDate_ > rateCurve_->referenceDate())
discount_ = rateCurve_->discount(paymentDate_);
if (paymentDate_ > nominalTermStructure_->referenceDate())
discount_ = nominalTermStructure_->discount(paymentDate_);
}
}

Expand Down
12 changes: 0 additions & 12 deletions ql/cashflows/iborcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@

namespace QuantLib {

void IborCoupon::createAtParCoupons() {
Settings::instance().createAtParCoupons();
}

void IborCoupon::createIndexedCoupons() {
Settings::instance().createIndexedCoupons();
}

bool IborCoupon::usingAtParCoupons() {
return Settings::instance().usingAtParCoupons();
}

IborCoupon::IborCoupon(const Date& paymentDate,
Real nominal,
const Date& startDate,
Expand Down
12 changes: 0 additions & 12 deletions ql/cashflows/iborcoupon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,6 @@ namespace QuantLib {
public:
// IborCoupon::Settings forward declaration
class Settings;
/*! \deprecated Use IborCouponSettings::Settings::instance().createAtParCoupons() instead
Deprecated in version 1.24.
*/
QL_DEPRECATED static void createAtParCoupons();
/*! \deprecated Use IborCouponSettings::Settings::instance().createIndexedCoupons() instead
Deprecated in version 1.24.
*/
QL_DEPRECATED static void createIndexedCoupons();
/*! \deprecated Use IborCouponSettings::Settings::instance().usingAtParCoupons() instead
Deprecated in version 1.24.
*/
QL_DEPRECATED static bool usingAtParCoupons();
};


Expand Down
15 changes: 3 additions & 12 deletions ql/cashflows/inflationcouponpricer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,16 @@ namespace QuantLib {
spread_ = coupon_->spread();
paymentDate_ = coupon_->date();

QL_DEPRECATED_DISABLE_WARNING
rateCurve_ =
!nominalTermStructure_.empty() ?
nominalTermStructure_ :
ext::dynamic_pointer_cast<YoYInflationIndex>(coupon.index())
->yoyInflationTermStructure()
->nominalTermStructure();
QL_DEPRECATED_ENABLE_WARNING

// past or future fixing is managed in YoYInflationIndex::fixing()
// use yield curve from index (which sets discount)

discount_ = 1.0;
if (rateCurve_.empty()) {
if (nominalTermStructure_.empty()) {
// allow to extract rates, but mark the discount as invalid for prices
discount_ = Null<Real>();
} else {
if (paymentDate_ > rateCurve_->referenceDate())
discount_ = rateCurve_->discount(paymentDate_);
if (paymentDate_ > nominalTermStructure_->referenceDate())
discount_ = nominalTermStructure_->discount(paymentDate_);
}
}

Expand Down
11 changes: 9 additions & 2 deletions ql/cashflows/inflationcouponpricer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ namespace QuantLib {
class InflationCouponPricer: public virtual Observer,
public virtual Observable {
public:
QL_DEPRECATED_DISABLE_WARNING
InflationCouponPricer() = default;
~InflationCouponPricer() override = default;
QL_DEPRECATED_ENABLE_WARNING
//! \name Interface
//@{
virtual Real swapletPrice() const = 0;
Expand All @@ -70,8 +73,12 @@ namespace QuantLib {
void update() override { notifyObservers(); }
//@}
protected:
Handle<YieldTermStructure> rateCurve_;
Date paymentDate_;
/*! \deprecated Don't use this data member. If you need it,
provide it in your derived class.
Deprecated in version 1.29.
*/
QL_DEPRECATED Handle<YieldTermStructure> rateCurve_;
Date paymentDate_;
};


Expand Down
3 changes: 1 addition & 2 deletions ql/experimental/credit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ cpp_files = \
recoveryratequote.cpp \
riskyassetswap.cpp \
riskyassetswapoption.cpp \
riskybond.cpp \
syntheticcdo.cpp

if UNITY_BUILD
Expand Down Expand Up @@ -106,7 +105,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, $(this_include_HEADERS)); do \
for i in $(filter-out all.hpp riskybond.hpp, $(this_include_HEADERS)); do \
echo "#include <${subdir}/$$i>" >> ${srcdir}/$@; \
done
echo >> ${srcdir}/$@
Expand Down
1 change: 0 additions & 1 deletion ql/experimental/credit/all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <ql/experimental/credit/recursivelossmodel.hpp>
#include <ql/experimental/credit/riskyassetswap.hpp>
#include <ql/experimental/credit/riskyassetswapoption.hpp>
#include <ql/experimental/credit/riskybond.hpp>
#include <ql/experimental/credit/saddlepointlossmodel.hpp>
#include <ql/experimental/credit/spotlosslatentmodel.hpp>
#include <ql/experimental/credit/spreadedhazardratecurve.hpp>
Expand Down
Loading

0 comments on commit b942a80

Please sign in to comment.