Skip to content

Commit

Permalink
Remove features deprecated in version 1.31 (#2029)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Jul 23, 2024
2 parents 40bd338 + 53722a4 commit 03e0c62
Show file tree
Hide file tree
Showing 32 changed files with 28 additions and 909 deletions.
4 changes: 0 additions & 4 deletions QuantLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@
<ClInclude Include="ql\math\copulas\maxcopula.hpp" />
<ClInclude Include="ql\math\copulas\mincopula.hpp" />
<ClInclude Include="ql\math\copulas\plackettcopula.hpp" />
<ClInclude Include="ql\math\curve.hpp" />
<ClInclude Include="ql\math\distributions\all.hpp" />
<ClInclude Include="ql\math\distributions\binomialdistribution.hpp" />
<ClInclude Include="ql\math\distributions\bivariatenormaldistribution.hpp" />
Expand Down Expand Up @@ -1056,7 +1055,6 @@
<ClInclude Include="ql\math\interpolations\sabrinterpolation.hpp" />
<ClInclude Include="ql\math\interpolations\xabrinterpolation.hpp" />
<ClInclude Include="ql\math\kernelfunctions.hpp" />
<ClInclude Include="ql\math\lexicographicalview.hpp" />
<ClInclude Include="ql\math\linearleastsquaresregression.hpp" />
<ClInclude Include="ql\math\matrix.hpp" />
<ClInclude Include="ql\math\matrixutilities\all.hpp" />
Expand Down Expand Up @@ -1465,7 +1463,6 @@
<ClInclude Include="ql\models\volatility\garmanklass.hpp" />
<ClInclude Include="ql\models\volatility\simplelocalestimator.hpp" />
<ClInclude Include="ql\patterns\all.hpp" />
<ClInclude Include="ql\patterns\composite.hpp" />
<ClInclude Include="ql\patterns\curiouslyrecurring.hpp" />
<ClInclude Include="ql\patterns\lazyobject.hpp" />
<ClInclude Include="ql\patterns\observable.hpp" />
Expand Down Expand Up @@ -1754,7 +1751,6 @@
<ClInclude Include="ql\termstructures\yield\bootstraptraits.hpp" />
<ClInclude Include="ql\termstructures\yield\compositezeroyieldstructure.hpp" />
<ClInclude Include="ql\termstructures\yield\discountcurve.hpp" />
<ClInclude Include="ql\termstructures\yield\drifttermstructure.hpp" />
<ClInclude Include="ql\termstructures\yield\fittedbonddiscountcurve.hpp" />
<ClInclude Include="ql\termstructures\yield\flatforward.hpp" />
<ClInclude Include="ql\termstructures\yield\forwardcurve.hpp" />
Expand Down
12 changes: 0 additions & 12 deletions QuantLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,6 @@
<ClInclude Include="ql\math\comparison.hpp">
<Filter>math</Filter>
</ClInclude>
<ClInclude Include="ql\math\curve.hpp">
<Filter>math</Filter>
</ClInclude>
<ClInclude Include="ql\math\errorfunction.hpp">
<Filter>math</Filter>
</ClInclude>
Expand Down Expand Up @@ -1011,9 +1008,6 @@
<ClInclude Include="ql\math\kernelfunctions.hpp">
<Filter>math</Filter>
</ClInclude>
<ClInclude Include="ql\math\lexicographicalview.hpp">
<Filter>math</Filter>
</ClInclude>
<ClInclude Include="ql\math\linearleastsquaresregression.hpp">
<Filter>math</Filter>
</ClInclude>
Expand Down Expand Up @@ -1440,9 +1434,6 @@
<ClInclude Include="ql\patterns\all.hpp">
<Filter>patterns</Filter>
</ClInclude>
<ClInclude Include="ql\patterns\composite.hpp">
<Filter>patterns</Filter>
</ClInclude>
<ClInclude Include="ql\patterns\curiouslyrecurring.hpp">
<Filter>patterns</Filter>
</ClInclude>
Expand Down Expand Up @@ -2136,9 +2127,6 @@
<ClInclude Include="ql\termstructures\yield\discountcurve.hpp">
<Filter>termstructures\yield</Filter>
</ClInclude>
<ClInclude Include="ql\termstructures\yield\drifttermstructure.hpp">
<Filter>termstructures\yield</Filter>
</ClInclude>
<ClInclude Include="ql\termstructures\yield\fittedbonddiscountcurve.hpp">
<Filter>termstructures\yield</Filter>
</ClInclude>
Expand Down
4 changes: 0 additions & 4 deletions cmake/GenerateHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 0 additions & 4 deletions ql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions ql/cashflows/conundrumpricer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ namespace QuantLib {
ext::shared_ptr<SmileSection> smile_;
};

/*! \deprecated Renamed to MarketQuotedOptionPricer.
Deprecated in version 1.31.
*/
[[deprecated("Renamed to MarketQuotedOptionPricer")]]
typedef MarketQuotedOptionPricer BlackVanillaOptionPricer;

class GFunction {
public:
virtual ~GFunction() = default;
Expand Down
100 changes: 13 additions & 87 deletions ql/cashflows/cpicoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

namespace QuantLib {

QL_DEPRECATED_DISABLE_WARNING

CPICoupon::CPICoupon(Real baseCPI,
const Date& paymentDate,
Real nominal,
Expand All @@ -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<Date>(), paymentDate, nominal, startDate, endDate,
index, observationLag, observationInterpolation, dayCounter,
fixedRate, refPeriodStart, refPeriodEnd, exCouponDate) {}

CPICoupon::CPICoupon(const Date& baseDate,
const Date& paymentDate,
Expand All @@ -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<Real>(), baseDate, paymentDate, nominal, startDate, endDate,
index, observationLag, observationInterpolation, dayCounter,
fixedRate, refPeriodStart, refPeriodEnd, exCouponDate) {}

CPICoupon::CPICoupon(Real baseCPI,
const Date& baseDate,
Expand All @@ -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<ZeroInflationIndex>& 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<Date>(), 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<ZeroInflationIndex>& 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<Real>(), 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<ZeroInflationIndex>& 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<Rate>() || baseDate != Null<Date>(),
"baseCPI and baseDate can not be both null, provide a valid baseCPI or baseDate");
QL_REQUIRE(baseCPI_ != Null<Rate>() || baseDate != Null<Date>(),
"baseCPI and baseDate can not be both null, provide a valid baseCPI or baseDate");
QL_REQUIRE(baseCPI_ == Null<Rate>() || 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<Visitor<CPICoupon>*>(&v);
if (v1 != nullptr)
Expand Down Expand Up @@ -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<Real>(1, 0)), baseDate_(Null<Date>()) {}
paymentCalendar_(schedule_.calendar()), baseDate_(Null<Date>()) {}


CPILeg& CPILeg::withObservationInterpolation(CPI::InterpolationType interp) {
Expand Down Expand Up @@ -311,16 +250,6 @@ namespace QuantLib {
return *this;
}

CPILeg& CPILeg::withSpreads(Spread spread) {
spreads_ = std::vector<Spread>(1,spread);
return *this;
}

CPILeg& CPILeg::withSpreads(const std::vector<Spread>& spreads) {
spreads_ = spreads;
return *this;
}

CPILeg& CPILeg::withCaps(Rate cap) {
caps_ = std::vector<Rate>(1,cap);
return *this;
Expand Down Expand Up @@ -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<Date>() && baseCPI_ == Null<Real>()) {
baseDate = schedule_.date(0) - observationLag_;
Expand Down Expand Up @@ -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<FixedRateCoupon>
(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<CPICoupon>
(baseCPI_, // all have same base for ratio
baseDate,
Expand All @@ -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.");
}
Expand Down
Loading

0 comments on commit 03e0c62

Please sign in to comment.