# QuantLib_CPICapFloor man page

CPICapFloor — CPI cap or floor.

## Synopsis

`#include <ql/instruments/cpicapfloor.hpp>`

Inherits **Instrument**.

### Public Member Functions

CPICapFloor(Option::Type type,Realnominal, constDate&startDate,RealbaseCPI, constDate&maturity, constCalendar&fixCalendar,BusinessDayConventionfixConvention, constCalendar&payCalendar,BusinessDayConventionpayConvention,Rate strike, constHandle<ZeroInflationIndex> &infIndex, constPeriod&observationLag, CPI::InterpolationType observationInterpolation=CPI::AsIndex)

**Inspectors**

Option::Typetype() constReal nominal() constRate strike() const

$ K $ in the above formula.Date fixingDate() constDate payDate() constHandle<ZeroInflationIndex>inflationIndex() constPeriod observationLag() const

**Instrument interface**

boolisExpired() const

returns whether the instrument might have value greater than zero.

voidsetupArguments(PricingEngine::arguments *) const

voidfetchResults(const PricingEngine::results *r) const

### Protected Attributes

Option::Typetype_Real nominal_Date startDate_Date fixDate_Date payDate_Real baseCPI_Date maturity_Calendar fixCalendar_BusinessDayConvention fixConvention_Calendar payCalendar_BusinessDayConvention payConvention_Rate strike_Handle<ZeroInflationIndex>infIndex_Period observationLag_

CPI::InterpolationTypeobservationInterpolation_

### Additional Inherited Members

## Detailed Description

CPI cap or floor.

Quoted as a fixed strike rate $ K $. **Payoff**: [ P_n(0,T) max(y (N [(1+K)^{T}-1] - N left[ ac{I(T)}{I(0)} -1 right]), 0) ] where $ T $ is the maturity time, $ P_n(0,t) $ is the nominal discount factor at time $ t $, $ N $ is the notional, and $ I(t) $ is the inflation index value at time $ t $.

Inflation is generally available on every day, including holidays and weekends. Hence there is a variable to state whether the observe/fix dates for inflation are adjusted or not. The default is not to adjust.

N.B. a cpi cap or floor is an option, not a cap or floor on a coupon. Thus this is very similar to a ZCIIS and has a single flow, this is as usual for cpi because it is cumulative up to option maturity from base date.

We do not inherit from **Option**, although this would be reasonable, because we do not have that degree of generality.

## Member Function Documentation

### void setupArguments (PricingEngine::arguments *) const [virtual]

When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing engine is used.

Reimplemented from **Instrument**.

### void fetchResults (const PricingEngine::results * r) const [virtual]

When a derived result structure is defined for an instrument, this method should be overridden to read from it. This is mandatory in case a pricing engine is used.

Reimplemented from **Instrument**.

## Author

Generated automatically by Doxygen for QuantLib from the source code.

## Referenced By

CPICapFloor(3), fixCalendar_(3), fixConvention_(3), fixDate_(3), infIndex_(3), inflationIndex(3), maturity_(3), payCalendar_(3), payConvention_(3), payDate(3), payDate_(3), startDate_(3), strike(3) and type_(3) are aliases of QuantLib_CPICapFloor(3).