22#include <ql/termstructures/volatility/swaption/swaptionvolstructure.hpp>
23#include <ql/math/rounding.hpp>
33 const Date& referenceDate,
49 "non-positive swap tenor (" << p <<
") given");
56 QL_FAIL(
"invalid Time Unit (" << p.
units() <<
") for swap length");
61 const Date& end)
const {
62 QL_REQUIRE(end>start,
"swap end date (" << end <<
63 ") must be greater than start (" << start <<
")");
64 Time result = (end-start)/365.25*12.0;
71 bool extrapolate)
const {
72 QL_REQUIRE(swapTenor.
length() > 0,
73 "non-positive swap tenor (" << swapTenor <<
") given");
76 "swap tenor (" << swapTenor <<
") is past max tenor ("
81 bool extrapolate)
const {
83 "non-positive swap length (" <<
swapLength <<
") given");
86 "swap tenor (" <<
swapLength <<
") is past max tenor ("
virtual const Period & maxSwapTenor() const =0
the largest length for which the term structure can return vols
void checkSwapTenor(const Period &swapTenor, bool extrapolate) const
SwaptionVolatilityStructure(BusinessDayConvention bdc, const DayCounter &dc=DayCounter())
Time swapLength(const Period &swapTenor) const
implements the conversion between swap tenor and swap (time) length
Time maxSwapLength() const
the largest swapLength for which the term structure can return vols
Volatility term structure.
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer