boost::shared_ptr<SmileSection> SwaptionVolatilityHullWhite::smileSectionImpl(Time optionTime, Time swapLength) const { calculate(); Date optionDate = Date(static_cast<BigInteger>(optionInterpolator_(optionTime))); Rounding rounder(0); Period swapTenor(static_cast<Integer>(rounder(swapLength*12.0)), Months); return smileSection(optionDate, swapTenor); }
boost::shared_ptr<SmileSection> SwaptionVolCube2::smileSectionImpl(Time optionTime, Time swapLength) const { calculate(); Date optionDate = optionDateFromTime(optionTime); Rounding rounder(0); Period swapTenor(static_cast<Integer>(rounder(swapLength*12.0)), Months); // ensure that option date is valid fixing date optionDate = swapTenor > shortSwapIndexBase_->tenor() ? swapIndexBase_->fixingCalendar().adjust(optionDate, Following) : shortSwapIndexBase_->fixingCalendar().adjust(optionDate, Following); return smileSectionImpl(optionDate, swapTenor); }