/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2006 Ferdinando Ametrano This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email . The license is also available online at . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /*! \file swaptionvolcube2.hpp \brief Swaption volatility cube, fit-later-interpolate-early approach */ #ifndef quantlib_swaption_volcube_fit_later_interpolate_early_h #define quantlib_swaption_volcube_fit_later_interpolate_early_h #include #include namespace QuantLib { class SwaptionVolCube2 : public SwaptionVolatilityCube{ public: SwaptionVolCube2( const Handle& atmVolStructure, const std::vector& optionTenors, const std::vector& swapTenors, const std::vector& strikeSpreads, const std::vector > >& volSpreads, const boost::shared_ptr& swapIndexBase, bool vegaWeightedSmileFit); ////! \name LazyObject interface ////@{ void performCalculations() const; ////@} //! \name SwaptionVolatilityCube inspectors //@{ const Matrix& volSpreads(Size i) const { return volSpreadsMatrix_[i]; } boost::shared_ptr smileSection( const Date& optionDate, const Period& swapTenor) const; boost::shared_ptr smileSectionImpl( Time optionTime, Time swapLength) const; //@} private: mutable std::vector volSpreadsInterpolator_; mutable std::vector volSpreadsMatrix_; }; } #endif