31 const Date& referenceDate,
50 const Date& optionDate,
51 const Period& bondTenor)
const {
52 Date end = optionDate + bondTenor;
54 "negative bond tenor (" << bondTenor <<
") given");
57 return std::make_pair(optionTime, timeLength);
63 bool extrapolate)
const {
67 "negative bond tenor (" << bondTenor <<
") given");
70 "bond tenor (" << bondTenor <<
") is past max tenor ("
74 "strike (" << k <<
") is outside the curve domain ["
Callable-bond volatility structure.
virtual const Period & maxBondTenor() const =0
the largest length for which the term structure can return vols
virtual Time maxBondLength() const
the largest bondLength for which the term structure can return vols
virtual Rate maxStrike() const =0
the maximum strike for which the term structure can return vols
virtual std::pair< Time, Time > convertDates(const Date &optionDate, const Period &bondTenor) const
implements the conversion between dates and times
virtual Rate minStrike() const =0
the minimum strike for which the term structure can return vols
void checkRange(Time, Time, Rate strike, bool extrapolate) const
CallableBondVolatilityStructure(const DayCounter &dc=DayCounter(), BusinessDayConvention bdc=Following)
default constructor
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.
Basic term-structure functionality.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
period- and frequency-related classes and enumerations