35 ext::shared_ptr<IborIndex> iborIndex,
36 const vector<Date>& optionletDates,
37 const vector<Rate>& strikes,
47 vector<vector<
Rate>>(optionletDates.size(), strikes),
56 ext::shared_ptr<IborIndex> iborIndex,
57 const vector<Date>& optionletDates,
58 const vector<vector<Rate>>& strikes,
63 : calendar_(calendar), settlementDays_(settlementDays), businessDayConvention_(bdc),
64 dc_(
std::move(dc)), iborIndex_(
std::move(iborIndex)), type_(type),
65 displacement_(displacement), nOptionletDates_(optionletDates.size()),
66 optionletDates_(optionletDates), optionletTimes_(nOptionletDates_),
67 optionletAtmRates_(nOptionletDates_), optionletStrikes_(strikes),
68 optionletVolQuotes_(
std::move(
v)) {
88 "mismatch between number of option tenors (" <<
95 "non increasing option dates: " <<
io::ordinal(i) <<
100 <<
") and number of strikes ("
104 "mismatch between number of option tenors ("
109 "non increasing strikes at date "
132 ") must be less than optionletStrikes size (" <<
137 const vector<Volatility>&
142 ") must be less than optionletVolatilities size (" <<
Black-formula cap/floor engine.
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
Shared handle to an observable.
virtual void calculate() const
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
static Settings & instance()
access to the unique instance
void registerWithMarketData()
void performCalculations() const override
Calendar calendar() const override
std::vector< std::vector< Volatility > > optionletVolatilities_
const std::vector< Date > & optionletFixingDates() const override
const std::vector< Rate > & optionletStrikes(Size i) const override
ext::shared_ptr< IborIndex > iborIndex_
const std::vector< Time > & optionletFixingTimes() const override
const std::vector< Volatility > & optionletVolatilities(Size i) const override
VolatilityType volatilityType() const override
std::vector< Rate > optionletAtmRates_
std::vector< Time > optionletTimes_
std::vector< Date > optionletDates_
StrippedOptionlet(Natural settlementDays, const Calendar &calendar, BusinessDayConvention bdc, ext::shared_ptr< IborIndex > iborIndex, const std::vector< Date > &optionletDates, const std::vector< Rate > &strikes, std::vector< std::vector< Handle< Quote > > >, DayCounter dc, VolatilityType type=ShiftedLognormal, Real displacement=0.0)
Natural settlementDays() const override
DayCounter dayCounter() const override
std::vector< std::vector< Handle< Quote > > > optionletVolQuotes_
const std::vector< Rate > & atmOptionletRates() const override
BusinessDayConvention businessDayConvention() const override
std::vector< std::vector< Rate > > optionletStrikes_
Real displacement() const override
Size optionletMaturities() const override
BusinessDayConvention businessDayConvention_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
detail::percent_holder rate(Rate)
output rates and spreads as percentages
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container
Helper class to instantiate standard market cap/floor.
ext::shared_ptr< BlackVolTermStructure > v