template class xf::fintech::InflationCapFloorEngine

#include "inflation_capfloor_engine.hpp"

Overview

InflationCapFloorEngine Inflation Cap/Floor Engine.

Parameters:

DT data type supported include float and double.
LEN maximum length of array
template <
    typename DT,
    int LEN
    >
class InflationCapFloorEngine

Methods

InflationCapFloorEngine

InflationCapFloorEngine ()

default constructor

init

void init (
    int typeIn,
    DT forwardRateIn,
    DT* cfRateIn,
    DT nominalIn,
    DT gearingIn,
    DT accrualTimeIn,
    int size,
    DT* timeIn,
    DT* rateIn
    )

init initialize array and parameters

Parameters:

typeIn 0: Cap, 1: Floor. For Collar mode, it is actually the result of Cap mode minus the result of Floor mode.
forwardRateIn base of forward rate
cfRateIn cfRateIn[0]: Cap strike rate, cfRateIn[1]: Floor strike rate
nominalIn nominal principal
gearingIn gearing
accrualTimeIn accrual time
size the actual size of array timeIn
timeIn array time, the difference between the maturity date and the reference date, unit is year.
rateIn array rate

calcuNPV

DT calcuNPV (int len)

calcuNPV calculate NPV function

Parameters:

len length of year

Returns:

return the NPV result