QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CPILeg Class Reference

Helper class building a sequence of capped/floored CPI coupons. More...

#include <ql/cashflows/cpicoupon.hpp>

+ Collaboration diagram for CPILeg:

Public Member Functions

 CPILeg (const Schedule &schedule, ext::shared_ptr< ZeroInflationIndex > index, Real baseCPI, const Period &observationLag)
 
CPILegwithNotionals (Real notional)
 
CPILegwithNotionals (const std::vector< Real > &notionals)
 
CPILegwithFixedRates (Real fixedRate)
 
CPILegwithFixedRates (const std::vector< Real > &fixedRates)
 
CPILegwithPaymentDayCounter (const DayCounter &)
 
CPILegwithPaymentAdjustment (BusinessDayConvention)
 
CPILegwithPaymentCalendar (const Calendar &)
 
CPILegwithObservationInterpolation (CPI::InterpolationType)
 
CPILegwithSubtractInflationNominal (bool)
 
CPILegwithSpreads (Spread spread)
 
CPILegwithSpreads (const std::vector< Spread > &spreads)
 
CPILegwithCaps (Rate cap)
 
CPILegwithCaps (const std::vector< Rate > &caps)
 
CPILegwithFloors (Rate floor)
 
CPILegwithFloors (const std::vector< Rate > &floors)
 
CPILegwithExCouponPeriod (const Period &, const Calendar &, BusinessDayConvention, bool endOfMonth=false)
 
CPILegwithBaseDate (const Date &baseDate)
 
 operator Leg () const
 

Private Attributes

Schedule schedule_
 
ext::shared_ptr< ZeroInflationIndexindex_
 
Real baseCPI_
 
Period observationLag_
 
std::vector< Realnotionals_
 
std::vector< RealfixedRates_
 
DayCounter paymentDayCounter_
 
BusinessDayConvention paymentAdjustment_ = ModifiedFollowing
 
Calendar paymentCalendar_
 
CPI::InterpolationType observationInterpolation_ = CPI::AsIndex
 
bool subtractInflationNominal_ = true
 
std::vector< Spreadspreads_
 
std::vector< Ratecaps_
 
std::vector< Ratefloors_
 
Period exCouponPeriod_
 
Calendar exCouponCalendar_
 
BusinessDayConvention exCouponAdjustment_ = Following
 
bool exCouponEndOfMonth_ = false
 
Date baseDate_ = Null<Date>()
 

Detailed Description

Helper class building a sequence of capped/floored CPI coupons.

Also allowing for the inflated notional at the end... especially if there is only one date in the schedule. If the fixed rate is zero you get a FixedRateCoupon, otherwise you get a ZeroInflationCoupon.

Definition at line 277 of file cpicoupon.hpp.

Constructor & Destructor Documentation

◆ CPILeg()

CPILeg ( const Schedule schedule,
ext::shared_ptr< ZeroInflationIndex index,
Real  baseCPI,
const Period observationLag 
)

Definition at line 258 of file cpicoupon.cpp.

Member Function Documentation

◆ withNotionals() [1/2]

CPILeg & withNotionals ( Real  notional)

Definition at line 285 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withNotionals() [2/2]

CPILeg & withNotionals ( const std::vector< Real > &  notionals)

Definition at line 290 of file cpicoupon.cpp.

◆ withFixedRates() [1/2]

CPILeg & withFixedRates ( Real  fixedRate)

Definition at line 275 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withFixedRates() [2/2]

CPILeg & withFixedRates ( const std::vector< Real > &  fixedRates)

Definition at line 280 of file cpicoupon.cpp.

◆ withPaymentDayCounter()

CPILeg & withPaymentDayCounter ( const DayCounter dayCounter)

Definition at line 300 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withPaymentAdjustment()

CPILeg & withPaymentAdjustment ( BusinessDayConvention  convention)

Definition at line 305 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withPaymentCalendar()

CPILeg & withPaymentCalendar ( const Calendar cal)

Definition at line 310 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withObservationInterpolation()

CPILeg & withObservationInterpolation ( CPI::InterpolationType  interp)

Definition at line 269 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withSubtractInflationNominal()

CPILeg & withSubtractInflationNominal ( bool  growthOnly)

Definition at line 295 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withSpreads() [1/2]

CPILeg & withSpreads ( Spread  spread)
Deprecated:
Do not use this method. A spread doesn't make sense for these coupons. Deprecated in version 1.31.

Definition at line 315 of file cpicoupon.cpp.

◆ withSpreads() [2/2]

CPILeg & withSpreads ( const std::vector< Spread > &  spreads)
Deprecated:
Do not use this method. A spread doesn't make sense for these coupons. Deprecated in version 1.31.

Definition at line 320 of file cpicoupon.cpp.

◆ withCaps() [1/2]

CPILeg & withCaps ( Rate  cap)

Definition at line 325 of file cpicoupon.cpp.

◆ withCaps() [2/2]

CPILeg & withCaps ( const std::vector< Rate > &  caps)

Definition at line 330 of file cpicoupon.cpp.

◆ withFloors() [1/2]

CPILeg & withFloors ( Rate  floor)

Definition at line 335 of file cpicoupon.cpp.

◆ withFloors() [2/2]

CPILeg & withFloors ( const std::vector< Rate > &  floors)

Definition at line 340 of file cpicoupon.cpp.

◆ withExCouponPeriod()

CPILeg & withExCouponPeriod ( const Period period,
const Calendar cal,
BusinessDayConvention  convention,
bool  endOfMonth = false 
)

Definition at line 345 of file cpicoupon.cpp.

+ Here is the caller graph for this function:

◆ withBaseDate()

CPILeg & withBaseDate ( const Date baseDate)

Definition at line 357 of file cpicoupon.cpp.

◆ operator Leg()

operator Leg ( ) const

Definition at line 363 of file cpicoupon.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ schedule_

Schedule schedule_
private

Definition at line 315 of file cpicoupon.hpp.

◆ index_

ext::shared_ptr<ZeroInflationIndex> index_
private

Definition at line 316 of file cpicoupon.hpp.

◆ baseCPI_

Real baseCPI_
private

Definition at line 317 of file cpicoupon.hpp.

◆ observationLag_

Period observationLag_
private

Definition at line 318 of file cpicoupon.hpp.

◆ notionals_

std::vector<Real> notionals_
private

Definition at line 319 of file cpicoupon.hpp.

◆ fixedRates_

std::vector<Real> fixedRates_
private

Definition at line 320 of file cpicoupon.hpp.

◆ paymentDayCounter_

DayCounter paymentDayCounter_
private

Definition at line 321 of file cpicoupon.hpp.

◆ paymentAdjustment_

BusinessDayConvention paymentAdjustment_ = ModifiedFollowing
private

Definition at line 322 of file cpicoupon.hpp.

◆ paymentCalendar_

Calendar paymentCalendar_
private

Definition at line 323 of file cpicoupon.hpp.

◆ observationInterpolation_

CPI::InterpolationType observationInterpolation_ = CPI::AsIndex
private

Definition at line 324 of file cpicoupon.hpp.

◆ subtractInflationNominal_

bool subtractInflationNominal_ = true
private

Definition at line 325 of file cpicoupon.hpp.

◆ spreads_

std::vector<Spread> spreads_
private

Definition at line 326 of file cpicoupon.hpp.

◆ caps_

std::vector<Rate> caps_
private

Definition at line 327 of file cpicoupon.hpp.

◆ floors_

std::vector<Rate> floors_
private

Definition at line 327 of file cpicoupon.hpp.

◆ exCouponPeriod_

Period exCouponPeriod_
private

Definition at line 328 of file cpicoupon.hpp.

◆ exCouponCalendar_

Calendar exCouponCalendar_
private

Definition at line 329 of file cpicoupon.hpp.

◆ exCouponAdjustment_

BusinessDayConvention exCouponAdjustment_ = Following
private

Definition at line 330 of file cpicoupon.hpp.

◆ exCouponEndOfMonth_

bool exCouponEndOfMonth_ = false
private

Definition at line 331 of file cpicoupon.hpp.

◆ baseDate_

Date baseDate_ = Null<Date>()
private

Definition at line 332 of file cpicoupon.hpp.