Skip to content

Commit

Permalink
Remove features deprecated in version 1.28 (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Oct 20, 2023
2 parents 23156db + 24bbaaa commit 0a745fa
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 648 deletions.
4 changes: 0 additions & 4 deletions QuantLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@
<ClInclude Include="ql\currencies\exchangeratemanager.hpp" />
<ClInclude Include="ql\currencies\oceania.hpp" />
<ClInclude Include="ql\experimental\all.hpp" />
<ClInclude Include="ql\experimental\amortizingbonds\all.hpp" />
<ClInclude Include="ql\experimental\amortizingbonds\amortizingcmsratebond.hpp" />
<ClInclude Include="ql\experimental\amortizingbonds\amortizingfixedratebond.hpp" />
<ClInclude Include="ql\experimental\amortizingbonds\amortizingfloatingratebond.hpp" />
<ClInclude Include="ql\experimental\asian\all.hpp" />
<ClInclude Include="ql\experimental\asian\analytic_cont_geom_av_price_heston.hpp" />
<ClInclude Include="ql\experimental\asian\analytic_discr_geom_av_price_heston.hpp" />
Expand Down
15 changes: 0 additions & 15 deletions QuantLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@
<Filter Include="experimental">
<UniqueIdentifier>{4eadb3fc-a4ce-4e0c-bfe5-f23777a30a8d}</UniqueIdentifier>
</Filter>
<Filter Include="experimental\amortizingbonds">
<UniqueIdentifier>{101d6cdd-3e77-48cd-8bec-c84a252324f0}</UniqueIdentifier>
</Filter>
<Filter Include="experimental\averageois">
<UniqueIdentifier>{33f1be16-e858-4cfe-ba9c-483609826221}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -3606,18 +3603,6 @@
<ClInclude Include="ql\experimental\commodities\unitofmeasureconversionmanager.hpp">
<Filter>experimental\commodities</Filter>
</ClInclude>
<ClInclude Include="ql\experimental\amortizingbonds\all.hpp">
<Filter>experimental\amortizingbonds</Filter>
</ClInclude>
<ClInclude Include="ql\experimental\amortizingbonds\amortizingcmsratebond.hpp">
<Filter>experimental\amortizingbonds</Filter>
</ClInclude>
<ClInclude Include="ql\experimental\amortizingbonds\amortizingfixedratebond.hpp">
<Filter>experimental\amortizingbonds</Filter>
</ClInclude>
<ClInclude Include="ql\experimental\amortizingbonds\amortizingfloatingratebond.hpp">
<Filter>experimental\amortizingbonds</Filter>
</ClInclude>
<ClInclude Include="ql\experimental\averageois\all.hpp">
<Filter>experimental\averageois</Filter>
</ClInclude>
Expand Down
9 changes: 1 addition & 8 deletions cmake/GenerateHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions ql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ql/experimental/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
1 change: 0 additions & 1 deletion ql/experimental/all.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* This file is automatically generated; do not edit. */
/* Add the files to be included into Makefile.am instead. */

#include <ql/experimental/amortizingbonds/all.hpp>
#include <ql/experimental/asian/all.hpp>
#include <ql/experimental/averageois/all.hpp>
#include <ql/experimental/barrieroption/all.hpp>
Expand Down
22 changes: 0 additions & 22 deletions ql/experimental/amortizingbonds/Makefile.am

This file was deleted.

4 changes: 0 additions & 4 deletions ql/experimental/amortizingbonds/all.hpp

This file was deleted.

23 changes: 0 additions & 23 deletions ql/experimental/amortizingbonds/amortizingcmsratebond.hpp

This file was deleted.

23 changes: 0 additions & 23 deletions ql/experimental/amortizingbonds/amortizingfixedratebond.hpp

This file was deleted.

23 changes: 0 additions & 23 deletions ql/experimental/amortizingbonds/amortizingfloatingratebond.hpp

This file was deleted.

15 changes: 0 additions & 15 deletions ql/experimental/callablebonds/callablebond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,21 +138,6 @@ namespace QuantLib {
return solver.solve(f, accuracy, guess, minVol, maxVol);
}

Volatility CallableBond::impliedVolatility(
Real targetValue,
const Handle<YieldTermStructure>& 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 {

Expand Down
14 changes: 0 additions & 14 deletions ql/experimental/callablebonds/callablebond.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<YieldTermStructure>& 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
Expand Down
68 changes: 0 additions & 68 deletions ql/instruments/bonds/amortizingfixedratebond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real>& notionals,
const Schedule& schedule,
const std::vector<InterestRate>& 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,
Expand Down
33 changes: 0 additions & 33 deletions ql/instruments/bonds/amortizingfixedratebond.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,6 @@ namespace QuantLib {
const std::vector<Real>& 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<Real>& notionals,
const Schedule& schedule,
const std::vector<InterestRate>& 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:
Expand Down
Loading

0 comments on commit 0a745fa

Please sign in to comment.