From 403e8bd723f01988cf6b842350c79b603feb63bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Gerdin=20B=C3=B6rjesson?= Date: Thu, 9 Nov 2023 12:16:36 +0100 Subject: [PATCH] Change payment lag from Naurals to Ints --- SWIG/bonds.i | 4 ++-- SWIG/cashflows.i | 16 ++++++++-------- SWIG/ratehelpers.i | 4 ++-- SWIG/swap.i | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/SWIG/bonds.i b/SWIG/bonds.i index 88658ded6..608cc9960 100644 --- a/SWIG/bonds.i +++ b/SWIG/bonds.i @@ -210,7 +210,7 @@ class AmortizingFixedRateBond : public Bond { const BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const std::vector& redemptions = { 100.0 }, - Natural paymentLag = 0); + Integer paymentLag = 0); Frequency frequency() const; DayCounter dayCounter() const; }; @@ -241,7 +241,7 @@ class AmortizingFloatingRateBond : public Bond { const BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const std::vector& redemptions = { 100.0 }, - Natural paymentLag = 0);; + Integer paymentLag = 0); }; diff --git a/SWIG/cashflows.i b/SWIG/cashflows.i index 70b102721..a21f61b19 100644 --- a/SWIG/cashflows.i +++ b/SWIG/cashflows.i @@ -677,7 +677,7 @@ Leg _FixedRateLeg(const Schedule& schedule, BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const Calendar& paymentCalendar = Calendar(), - const Natural paymentLag = 0, + const Integer paymentLag = 0, Compounding comp = Simple, Frequency freq = Annual) { return QuantLib::FixedRateLeg(schedule) @@ -708,7 +708,7 @@ Leg _FixedRateLeg(const Schedule& schedule, BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const Calendar& paymentCalendar = Calendar(), - Natural paymentLag = 0, + Integer paymentLag = 0, Compounding compounding = Simple, Frequency compoundingFrequency = Annual); @@ -729,7 +729,7 @@ Leg _IborLeg(const std::vector& nominals, BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const Calendar& paymentCalendar = Calendar(), - const Natural paymentLag = 0, + const Integer paymentLag = 0, ext::optional withIndexedCoupons = ext::nullopt) { return QuantLib::IborLeg(schedule, index) .withNotionals(nominals) @@ -770,7 +770,7 @@ Leg _IborLeg(const std::vector& nominals, BusinessDayConvention exCouponConvention = Unadjusted, bool exCouponEndOfMonth = false, const Calendar& paymentCalendar = Calendar(), - Natural paymentLag = 0, + Integer paymentLag = 0, ext::optional withIndexedCoupons = ext::nullopt); %{ @@ -784,7 +784,7 @@ Leg _OvernightLeg(const std::vector& nominals, bool telescopicValueDates = false, RateAveraging::Type averagingMethod = RateAveraging::Compound, const Calendar& paymentCalendar = Calendar(), - const Natural paymentLag = 0) { + const Integer paymentLag = 0) { return QuantLib::OvernightLeg(schedule, index) .withNotionals(nominals) .withPaymentDayCounter(paymentDayCounter) @@ -811,7 +811,7 @@ Leg _OvernightLeg(const std::vector& nominals, bool telescopicValueDates = false, RateAveraging::Type averagingMethod = RateAveraging::Compound, const Calendar& paymentCalendar = Calendar(), - Natural paymentLag = 0); + Integer paymentLag = 0); %{ Leg _CmsLeg(const std::vector& nominals, @@ -958,7 +958,7 @@ Leg _SubPeriodsLeg(const std::vector& nominals, const DayCounter& paymentDayCounter = DayCounter(), const BusinessDayConvention paymentConvention = Following, const Calendar& paymentCalendar = Calendar(), - Natural paymentLag = 0, + Integer paymentLag = 0, const std::vector& fixingDays = std::vector(), const std::vector& gearings = std::vector(), const std::vector& couponSpreads = std::vector(), @@ -995,7 +995,7 @@ Leg _SubPeriodsLeg(const std::vector& nominals, const DayCounter& paymentDayCounter = DayCounter(), const BusinessDayConvention paymentConvention = Following, const Calendar& paymentCalendar = Calendar(), - Natural paymentLag = 0, + Integer paymentLag = 0, const std::vector& fixingDays = std::vector(), const std::vector& gearings = std::vector(), const std::vector& couponSpreads = std::vector(), diff --git a/SWIG/ratehelpers.i b/SWIG/ratehelpers.i index ca57cbff6..1c214ccf6 100644 --- a/SWIG/ratehelpers.i +++ b/SWIG/ratehelpers.i @@ -321,7 +321,7 @@ class OISRateHelper : public RateHelper { const ext::shared_ptr& index, const Handle& discountingCurve = {}, bool telescopicValueDates = false, - Natural paymentLag = 0, + Integer paymentLag = 0, BusinessDayConvention paymentConvention = Following, Frequency paymentFrequency = Annual, const Calendar& paymentCalendar = Calendar(), @@ -348,7 +348,7 @@ class DatedOISRateHelper : public RateHelper { const Handle& discountingCurve = {}, bool telescopicValueDates = false, RateAveraging::Type averagingMethod = RateAveraging::Compound, - Natural paymentLag = 0, + Integer paymentLag = 0, BusinessDayConvention paymentConvention = Following, Frequency paymentFrequency = Annual, const Calendar& paymentCalendar = Calendar(), diff --git a/SWIG/swap.i b/SWIG/swap.i index 57d53ff90..bd9f4e4e9 100644 --- a/SWIG/swap.i +++ b/SWIG/swap.i @@ -361,7 +361,7 @@ class OvernightIndexedSwap : public Swap { const DayCounter& fixedDC, const ext::shared_ptr& index, Spread spread = 0.0, - Natural paymentLag = 0, + Integer paymentLag = 0, BusinessDayConvention paymentAdjustment = Following, Calendar paymentCalendar = Calendar(), bool telescopicValueDates = false, @@ -375,7 +375,7 @@ class OvernightIndexedSwap : public Swap { const DayCounter& fixedDC, const ext::shared_ptr& index, Spread spread = 0.0, - Natural paymentLag = 0, + Integer paymentLag = 0, BusinessDayConvention paymentAdjustment = Following, Calendar paymentCalendar = Calendar(), bool telescopicValueDates = false, @@ -390,7 +390,7 @@ class OvernightIndexedSwap : public Swap { const Schedule& overnightSchedule, const ext::shared_ptr& overnightIndex, Spread spread = 0.0, - Natural paymentLag = 0, + Integer paymentLag = 0, BusinessDayConvention paymentAdjustment = Following, const Calendar& paymentCalendar = Calendar(), bool telescopicValueDates = false, @@ -441,7 +441,7 @@ class MakeOIS { MakeOIS& withRule(DateGeneration::Rule r); MakeOIS& withPaymentFrequency(Frequency f); MakeOIS& withPaymentAdjustment(BusinessDayConvention convention); - MakeOIS& withPaymentLag(Natural lag); + MakeOIS& withPaymentLag(Integer lag); MakeOIS& withPaymentCalendar(const Calendar& cal); MakeOIS& withEndOfMonth(bool flag = true); MakeOIS& withFixedLegDayCount(const DayCounter& dc);