Skip to content

Commit

Permalink
Avoid features deprecated in version 1.31 and removed in 1.36 (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jul 23, 2024
2 parents 71d7e64 + 6627281 commit a65a11e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 79 deletions.
2 changes: 1 addition & 1 deletion Java/examples/FRA.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void main(String[] args) throws Exception {
IborIndex euribor3m = new Euribor3M(flatTermStructure);

ForwardRateAgreement myFra =
new ForwardRateAgreement(startDate, type, strike, notional, euribor3m, flatTermStructure);
new ForwardRateAgreement(euribor3m, startDate, type, strike, notional, flatTermStructure);
System.out.println(myFra.amount());
System.out.println(myFra.NPV());
}
Expand Down
16 changes: 0 additions & 16 deletions SWIG/fra.i
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@ struct Position {
%shared_ptr(ForwardRateAgreement)
class ForwardRateAgreement : public Instrument {
public:
ForwardRateAgreement(const Date& valueDate,
const Date& maturityDate,
Position::Type type,
Rate strikeForwardRate,
Real notionalAmount,
const ext::shared_ptr<IborIndex>& index,
const Handle<YieldTermStructure>& discountCurve = Handle<YieldTermStructure>(),
bool useIndexedCoupon = true);

ForwardRateAgreement(const Date& valueDate,
Position::Type type,
Rate strikeForwardRate,
Real notionalAmount,
const ext::shared_ptr<IborIndex>& index,
const Handle<YieldTermStructure>& discountCurve = Handle<YieldTermStructure>());

ForwardRateAgreement(const ext::shared_ptr<IborIndex>& index,
const Date& valueDate,
Position::Type type,
Expand Down
62 changes: 0 additions & 62 deletions SWIG/inflation.i
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,6 @@ class YoYInflationIndex : public InflationIndex {
const Currency& currency,
Handle<YoYInflationTermStructure> ts = {});

// Deprecated constructor.
YoYInflationIndex(const std::string& familyName,
const Region& region,
bool revised,
bool interpolated,
bool ratio,
Frequency frequency,
const Period& availabilityLag,
const Currency& currency,
const Handle<YoYInflationTermStructure>& ts = {});
bool ratio() const;
bool interpolated() const;
ext::shared_ptr<ZeroInflationIndex> underlyingIndex() const;
Expand Down Expand Up @@ -255,15 +245,10 @@ class UKHICP : public ZeroInflationIndex {

export_yii_instance(YYEUHICP);
export_yii_instance(YYEUHICPXT);
export_yii_instance(YYEUHICPr);
export_yii_instance(YYFRHICP);
export_yii_instance(YYFRHICPr);
export_yii_instance(YYUKRPI);
export_yii_instance(YYUKRPIr);
export_yii_instance(YYUSCPI);
export_yii_instance(YYUSCPIr);
export_yii_instance(YYZACPI);
export_yii_instance(YYZACPIr);

%{
using QuantLib::AUCPI;
Expand Down Expand Up @@ -370,51 +355,7 @@ class CPICoupon : public InflationCoupon {
const Date& refPeriodStart = Date(),
const Date& refPeriodEnd = Date(),
const Date& exCouponDate = Date());
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 = Date(),
const Date& refPeriodEnd = Date(),
const Date& exCouponDate = Date());
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 = Date(),
const Date& refPeriodEnd = Date(),
const Date& exCouponDate = Date());
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 = Date(),
const Date& refPeriodEnd = Date(),
const Date& exCouponDate = Date());
Rate fixedRate() const;
Spread spread() const;
Rate adjustedIndexGrowth() const;
Rate indexFixing() const;
Real indexRatio(Date d) const;
Expand Down Expand Up @@ -464,7 +405,6 @@ Leg _CPILeg(const std::vector<Real>& nominals,
const DayCounter& paymentDayCounter = DayCounter(),
const BusinessDayConvention paymentConvention = Following,
const std::vector<Real>& fixedRates = std::vector<Real>(),
const std::vector<Spread>& spreads = std::vector<Spread>(),
const std::vector<Rate>& caps = std::vector<Rate>(),
const std::vector<Rate>& floors = std::vector<Rate>(),
const Period& exCouponPeriod = Period(),
Expand All @@ -480,7 +420,6 @@ Leg _CPILeg(const std::vector<Real>& nominals,
.withPaymentAdjustment(paymentConvention)
.withPaymentCalendar(paymentCalendar.empty() ? schedule.calendar() : paymentCalendar)
.withFixedRates(fixedRates)
.withSpreads(spreads)
.withCaps(caps)
.withFloors(floors)
.withExCouponPeriod(exCouponPeriod,
Expand All @@ -503,7 +442,6 @@ Leg _CPILeg(const std::vector<Real>& nominals,
const DayCounter& paymentDayCounter = DayCounter(),
const BusinessDayConvention paymentConvention = Following,
const std::vector<Real>& fixedRates = std::vector<Real>(),
const std::vector<Spread>& spreads = std::vector<Spread>(),
const std::vector<Rate>& caps = std::vector<Rate>(),
const std::vector<Rate>& floors = std::vector<Rate>(),
const Period& exCouponPeriod = Period(),
Expand Down

0 comments on commit a65a11e

Please sign in to comment.