/src/quantlib/ql/termstructures/volatility/inflation/constantcpivolatility.cpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2009, 2011 Chris Kenyon |
5 | | |
6 | | This file is part of QuantLib, a free-software/open-source library |
7 | | for financial quantitative analysts and developers - http://quantlib.org/ |
8 | | |
9 | | QuantLib is free software: you can redistribute it and/or modify it |
10 | | under the terms of the QuantLib license. You should have received a |
11 | | copy of the license along with this program; if not, please email |
12 | | <quantlib-dev@lists.sf.net>. The license is also available online at |
13 | | <https://www.quantlib.org/license.shtml>. |
14 | | |
15 | | This program is distributed in the hope that it will be useful, but WITHOUT |
16 | | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
17 | | FOR A PARTICULAR PURPOSE. See the license for more details. |
18 | | */ |
19 | | |
20 | | #include <ql/termstructures/volatility/inflation/constantcpivolatility.hpp> |
21 | | #include <ql/quotes/simplequote.hpp> |
22 | | |
23 | | namespace QuantLib { |
24 | | |
25 | | ConstantCPIVolatility:: ConstantCPIVolatility(const Handle<Quote>& vol, |
26 | | Natural settlementDays, |
27 | | const Calendar& cal, |
28 | | BusinessDayConvention bdc, |
29 | | const DayCounter& dc, |
30 | | const Period& observationLag, |
31 | | Frequency frequency, |
32 | | bool indexIsInterpolated) |
33 | 0 | : CPIVolatilitySurface(settlementDays, cal, bdc, dc, |
34 | 0 | observationLag, frequency, indexIsInterpolated), |
35 | 0 | volatility_(vol) {}Unexecuted instantiation: QuantLib::ConstantCPIVolatility::ConstantCPIVolatility(QuantLib::Handle<QuantLib::Quote> const&, unsigned int, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, QuantLib::DayCounter const&, QuantLib::Period const&, QuantLib::Frequency, bool) Unexecuted instantiation: QuantLib::ConstantCPIVolatility::ConstantCPIVolatility(QuantLib::Handle<QuantLib::Quote> const&, unsigned int, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, QuantLib::DayCounter const&, QuantLib::Period const&, QuantLib::Frequency, bool) |
36 | | |
37 | | ConstantCPIVolatility:: ConstantCPIVolatility(Volatility vol, |
38 | | Natural settlementDays, |
39 | | const Calendar& cal, |
40 | | BusinessDayConvention bdc, |
41 | | const DayCounter& dc, |
42 | | const Period& observationLag, |
43 | | Frequency frequency, |
44 | | bool indexIsInterpolated) |
45 | 0 | : CPIVolatilitySurface(settlementDays, cal, bdc, dc, |
46 | 0 | observationLag, frequency, indexIsInterpolated), |
47 | 0 | volatility_(ext::make_shared<SimpleQuote>(vol)) {}Unexecuted instantiation: QuantLib::ConstantCPIVolatility::ConstantCPIVolatility(double, unsigned int, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, QuantLib::DayCounter const&, QuantLib::Period const&, QuantLib::Frequency, bool) Unexecuted instantiation: QuantLib::ConstantCPIVolatility::ConstantCPIVolatility(double, unsigned int, QuantLib::Calendar const&, QuantLib::BusinessDayConvention, QuantLib::DayCounter const&, QuantLib::Period const&, QuantLib::Frequency, bool) |
48 | | |
49 | | |
50 | 0 | Volatility ConstantCPIVolatility::volatilityImpl(Time, Rate) const { |
51 | 0 | return volatility_->value(); |
52 | 0 | } |
53 | | |
54 | | } |
55 | | |