/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2003, 2004, 2005 StatPro Italia srl 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 capflatvolvector.hpp \brief Cap/floor at-the-money flat volatility vector */ #ifndef quantlib_cap_volatility_vector_hpp #define quantlib_cap_volatility_vector_hpp #include #include #include #include namespace QuantLib { //! Cap/floor at-the-money term-volatility vector /*! This class provides the at-the-money volatility for a given cap by interpolating a volatility vector whose elements are the market volatilities of a set of caps/floors with given length. \todo either add correct copy behavior or inhibit copy. Right now, a copied instance would end up with its own copy of the length vector but an interpolation pointing to the original ones. */ class CapVolatilityVector : public CapVolatilityStructure { public: CapVolatilityVector(const Date& settlementDate, const std::vector& lengths, const std::vector& volatilities, const DayCounter& dayCounter); CapVolatilityVector(Natural settlementDays, const Calendar& calendar, const std::vector& lengths, const std::vector& volatilities, const DayCounter& dayCounter); // inspectors DayCounter dayCounter() const { return dayCounter_; } Date maxDate() const; Real minStrike() const; Real maxStrike() const; // observability void update(); private: DayCounter dayCounter_; std::vector lengths_; std::vector