Skip to content

Commit

Permalink
Changed paymentLag type to Integer (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Oct 26, 2023
2 parents 6441d1b + 90028ed commit 428bdd4
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion ql/cashflows/cashflowvectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace QuantLib {
const std::vector<Rate>& floors,
bool isInArrears,
bool isZero,
Natural paymentLag = 0,
Integer paymentLag = 0,
Calendar paymentCalendar = Calendar(),
Period exCouponPeriod = Period(),
Calendar exCouponCalendar = Calendar(),
Expand Down
2 changes: 1 addition & 1 deletion ql/cashflows/fixedratecoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace QuantLib {
return *this;
}

FixedRateLeg& FixedRateLeg::withPaymentLag(Natural lag) {
FixedRateLeg& FixedRateLeg::withPaymentLag(Integer lag) {
paymentLag_ = lag;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions ql/cashflows/fixedratecoupon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace QuantLib {
FixedRateLeg& withFirstPeriodDayCounter(const DayCounter&);
FixedRateLeg& withLastPeriodDayCounter(const DayCounter&);
FixedRateLeg& withPaymentCalendar(const Calendar&);
FixedRateLeg& withPaymentLag(Natural lag);
FixedRateLeg& withPaymentLag(Integer lag);
FixedRateLeg& withExCouponPeriod(const Period&,
const Calendar&,
BusinessDayConvention,
Expand All @@ -119,7 +119,7 @@ namespace QuantLib {
DayCounter firstPeriodDC_ , lastPeriodDC_;
Calendar paymentCalendar_;
BusinessDayConvention paymentAdjustment_ = Following;
Natural paymentLag_ = 0;
Integer paymentLag_ = 0;
Period exCouponPeriod_;
Calendar exCouponCalendar_;
BusinessDayConvention exCouponAdjustment_ = Following;
Expand Down
2 changes: 1 addition & 1 deletion ql/cashflows/iborcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ namespace QuantLib {
return *this;
}

IborLeg& IborLeg::withPaymentLag(Natural lag) {
IborLeg& IborLeg::withPaymentLag(Integer lag) {
paymentLag_ = lag;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions ql/cashflows/iborcoupon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace QuantLib {
IborLeg& withNotionals(const std::vector<Real>& notionals);
IborLeg& withPaymentDayCounter(const DayCounter&);
IborLeg& withPaymentAdjustment(BusinessDayConvention);
IborLeg& withPaymentLag(Natural lag);
IborLeg& withPaymentLag(Integer lag);
IborLeg& withPaymentCalendar(const Calendar&);
IborLeg& withFixingDays(Natural fixingDays);
IborLeg& withFixingDays(const std::vector<Natural>& fixingDays);
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace QuantLib {
std::vector<Real> notionals_;
DayCounter paymentDayCounter_;
BusinessDayConvention paymentAdjustment_ = Following;
Natural paymentLag_ = 0;
Integer paymentLag_ = 0;
Calendar paymentCalendar_;
std::vector<Natural> fixingDays_;
std::vector<Real> gearings_;
Expand Down
2 changes: 1 addition & 1 deletion ql/cashflows/overnightindexedcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ namespace QuantLib {
return *this;
}

OvernightLeg& OvernightLeg::withPaymentLag(Natural lag) {
OvernightLeg& OvernightLeg::withPaymentLag(Integer lag) {
paymentLag_ = lag;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions ql/cashflows/overnightindexedcoupon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace QuantLib {
OvernightLeg& withPaymentDayCounter(const DayCounter&);
OvernightLeg& withPaymentAdjustment(BusinessDayConvention);
OvernightLeg& withPaymentCalendar(const Calendar&);
OvernightLeg& withPaymentLag(Natural lag);
OvernightLeg& withPaymentLag(Integer lag);
OvernightLeg& withGearings(Real gearing);
OvernightLeg& withGearings(const std::vector<Real>& gearings);
OvernightLeg& withSpreads(Spread spread);
Expand All @@ -116,7 +116,7 @@ namespace QuantLib {
DayCounter paymentDayCounter_;
Calendar paymentCalendar_;
BusinessDayConvention paymentAdjustment_ = Following;
Natural paymentLag_ = 0;
Integer paymentLag_ = 0;
std::vector<Real> gearings_;
std::vector<Spread> spreads_;
bool telescopicValueDates_ = false;
Expand Down
2 changes: 1 addition & 1 deletion ql/cashflows/subperiodcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ namespace QuantLib {
return *this;
}

SubPeriodsLeg& SubPeriodsLeg::withPaymentLag(Natural lag) {
SubPeriodsLeg& SubPeriodsLeg::withPaymentLag(Integer lag) {
paymentLag_ = lag;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions ql/cashflows/subperiodcoupon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace QuantLib {
SubPeriodsLeg& withPaymentDayCounter(const DayCounter&);
SubPeriodsLeg& withPaymentAdjustment(BusinessDayConvention);
SubPeriodsLeg& withPaymentCalendar(const Calendar&);
SubPeriodsLeg& withPaymentLag(Natural lag);
SubPeriodsLeg& withPaymentLag(Integer lag);
SubPeriodsLeg& withFixingDays(Natural fixingDays);
SubPeriodsLeg& withFixingDays(const std::vector<Natural>& fixingDays);
SubPeriodsLeg& withGearings(Real gearing);
Expand All @@ -149,7 +149,7 @@ namespace QuantLib {
DayCounter paymentDayCounter_;
Calendar paymentCalendar_;
BusinessDayConvention paymentAdjustment_ = Following;
Natural paymentLag_ = 0;
Integer paymentLag_ = 0;
std::vector<Natural> fixingDays_;
std::vector<Real> gearings_;
std::vector<Spread> couponSpreads_;
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/bonds/amortizingfixedratebond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace QuantLib {
const BusinessDayConvention exCouponConvention,
bool exCouponEndOfMonth,
const std::vector<Real>& redemptions,
Natural paymentLag)
Integer paymentLag)
: Bond(settlementDays, schedule.calendar(), issueDate),
frequency_(schedule.tenor().frequency()),
dayCounter_(accrualDayCounter) {
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/bonds/amortizingfixedratebond.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace QuantLib {
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const std::vector<Real>& redemptions = { 100.0 },
Natural paymentLag = 0);
Integer paymentLag = 0);

Frequency frequency() const { return frequency_; }
const DayCounter& dayCounter() const { return dayCounter_; }
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/bonds/amortizingfloatingratebond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace QuantLib {
const BusinessDayConvention exCouponConvention,
bool exCouponEndOfMonth,
const std::vector<Real>& redemptions,
Natural paymentLag)
Integer paymentLag)
: Bond(settlementDays, schedule.calendar(), issueDate) {

maturityDate_ = schedule.endDate();
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/bonds/amortizingfloatingratebond.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace QuantLib {
BusinessDayConvention exCouponConvention = Unadjusted,
bool exCouponEndOfMonth = false,
const std::vector<Real>& redemptions = { 100.0 },
Natural paymentLag = 0);
Integer paymentLag = 0);
};

}
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/fixedvsfloatingswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace QuantLib {
Spread spread,
DayCounter floatingDayCount,
ext::optional<BusinessDayConvention> paymentConvention,
Natural paymentLag,
Integer paymentLag,
const Calendar& paymentCalendar)
: Swap(2), type_(type), fixedNominals_(std::move(fixedNominals)), fixedSchedule_(std::move(fixedSchedule)),
fixedRate_(fixedRate), fixedDayCount_(std::move(fixedDayCount)),
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/fixedvsfloatingswap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace QuantLib {
Spread spread,
DayCounter floatingDayCount,
ext::optional<BusinessDayConvention> paymentConvention = ext::nullopt,
Natural paymentLag = 0,
Integer paymentLag = 0,
const Calendar& paymentCalendar = Calendar());
//! \name Inspectors
//@{
Expand Down
2 changes: 1 addition & 1 deletion ql/instruments/makeois.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace QuantLib {
return *this;
}

MakeOIS& MakeOIS::withPaymentLag(Natural lag) {
MakeOIS& MakeOIS::withPaymentLag(Integer lag) {
paymentLag_ = lag;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions ql/instruments/makeois.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace QuantLib {

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);
Expand Down Expand Up @@ -88,7 +88,7 @@ namespace QuantLib {
Frequency paymentFrequency_ = Annual;
Calendar paymentCalendar_;
BusinessDayConvention paymentAdjustment_ = Following;
Natural paymentLag_ = 0;
Integer paymentLag_ = 0;

DateGeneration::Rule rule_ = DateGeneration::Backward;
bool endOfMonth_ = false, isDefaultEOM_ = true;
Expand Down
8 changes: 4 additions & 4 deletions ql/instruments/overnightindexedswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace QuantLib {
DayCounter fixedDC,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentAdjustment,
const Calendar& paymentCalendar,
bool telescopicValueDates,
Expand All @@ -59,7 +59,7 @@ namespace QuantLib {
DayCounter fixedDC,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentAdjustment,
const Calendar& paymentCalendar,
bool telescopicValueDates,
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace QuantLib {
const Schedule& overnightSchedule,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentAdjustment,
const Calendar& paymentCalendar,
bool telescopicValueDates,
Expand Down Expand Up @@ -116,7 +116,7 @@ namespace QuantLib {
const Schedule& overnightSchedule,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentAdjustment,
const Calendar& paymentCalendar,
bool telescopicValueDates,
Expand Down
8 changes: 4 additions & 4 deletions ql/instruments/overnightindexedswap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace QuantLib {
DayCounter fixedDC,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
const Calendar& paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand All @@ -61,7 +61,7 @@ namespace QuantLib {
DayCounter fixedDC,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
const Calendar& paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand All @@ -75,7 +75,7 @@ namespace QuantLib {
const Schedule& overnightSchedule,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
const Calendar& paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand All @@ -90,7 +90,7 @@ namespace QuantLib {
const Schedule& overnightSchedule,
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Spread spread = 0.0,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentAdjustment = Following,
const Calendar& paymentCalendar = Calendar(),
bool telescopicValueDates = false,
Expand Down
4 changes: 2 additions & 2 deletions ql/termstructures/yield/oisratehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace QuantLib {
const ext::shared_ptr<OvernightIndex>& overnightIndex,
Handle<YieldTermStructure> discount,
bool telescopicValueDates,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentConvention,
Frequency paymentFrequency,
Calendar paymentCalendar,
Expand Down Expand Up @@ -156,7 +156,7 @@ namespace QuantLib {
Handle<YieldTermStructure> discount,
bool telescopicValueDates,
RateAveraging::Type averagingMethod,
Natural paymentLag,
Integer paymentLag,
BusinessDayConvention paymentConvention,
Frequency paymentFrequency,
const Calendar& paymentCalendar,
Expand Down
6 changes: 3 additions & 3 deletions ql/termstructures/yield/oisratehelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace QuantLib {
// exogenous discounting curve
Handle<YieldTermStructure> discountingCurve = {},
bool telescopicValueDates = false,
Natural paymentLag = 0,
Integer paymentLag = 0,
BusinessDayConvention paymentConvention = Following,
Frequency paymentFrequency = Annual,
Calendar paymentCalendar = Calendar(),
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace QuantLib {
bool telescopicValueDates_;
RelinkableHandle<YieldTermStructure> discountRelinkableHandle_;

Natural paymentLag_;
Integer paymentLag_;
BusinessDayConvention paymentConvention_;
Frequency paymentFrequency_;
Calendar paymentCalendar_;
Expand All @@ -101,7 +101,7 @@ namespace QuantLib {
Handle<YieldTermStructure> 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(),
Expand Down
4 changes: 2 additions & 2 deletions test-suite/overnightindexedswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace overnight_indexed_swap_test {
Spread spread,
bool telescopicValueDates,
Date effectiveDate = Null<Date>(),
Natural paymentLag = 0,
Integer paymentLag = 0,
RateAveraging::Type averagingMethod = RateAveraging::Compound) {
return MakeOIS(length, eoniaIndex, fixedRate, 0 * Days)
.withEffectiveDate(effectiveDate == Null<Date>() ? settlement : effectiveDate)
Expand Down Expand Up @@ -303,7 +303,7 @@ namespace overnight_indexed_swap_test {

CommonVars vars;

Natural paymentLag = 2;
Integer paymentLag = 2;

std::vector<ext::shared_ptr<RateHelper> > eoniaHelpers;

Expand Down

0 comments on commit 428bdd4

Please sign in to comment.