/src/quantlib/ql/pricingengines/swaption/blackswaptionengine.cpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2007, 2008 Ferdinando Ametrano |
5 | | Copyright (C) 2006 Cristina Duminuco |
6 | | Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb |
7 | | Copyright (C) 2006, 2007 StatPro Italia srl |
8 | | Copyright (C) 2015, 2016, 2017 Peter Caspers |
9 | | Copyright (C) 2017 Paul Giltinan |
10 | | Copyright (C) 2017 Werner Kuerzinger |
11 | | |
12 | | This file is part of QuantLib, a free-software/open-source library |
13 | | for financial quantitative analysts and developers - http://quantlib.org/ |
14 | | |
15 | | QuantLib is free software: you can redistribute it and/or modify it |
16 | | under the terms of the QuantLib license. You should have received a |
17 | | copy of the license along with this program; if not, please email |
18 | | <quantlib-dev@lists.sf.net>. The license is also available online at |
19 | | <https://www.quantlib.org/license.shtml>. |
20 | | |
21 | | This program is distributed in the hope that it will be useful, but WITHOUT |
22 | | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
23 | | FOR A PARTICULAR PURPOSE. See the license for more details. |
24 | | */ |
25 | | |
26 | | #include <ql/pricingengines/swaption/blackswaptionengine.hpp> |
27 | | |
28 | | namespace QuantLib { |
29 | | |
30 | | BlackSwaptionEngine::BlackSwaptionEngine( |
31 | | const Handle<YieldTermStructure> &discountCurve, |
32 | | Volatility vol, const DayCounter &dc, |
33 | | Real displacement, CashAnnuityModel model) |
34 | 0 | : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol, dc, |
35 | 0 | displacement, model) {} |
36 | | |
37 | | BlackSwaptionEngine::BlackSwaptionEngine( |
38 | | const Handle<YieldTermStructure> &discountCurve, |
39 | | const Handle<Quote> &vol, |
40 | | const DayCounter &dc, |
41 | | Real displacement, |
42 | | CashAnnuityModel model) |
43 | 0 | : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol, dc, |
44 | 0 | displacement, model) {} |
45 | | |
46 | | BlackSwaptionEngine::BlackSwaptionEngine( |
47 | | const Handle<YieldTermStructure> &discountCurve, |
48 | | const Handle<SwaptionVolatilityStructure> &vol, |
49 | | CashAnnuityModel model) |
50 | 0 | : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol, |
51 | 0 | model) { |
52 | 0 | QL_REQUIRE(vol->volatilityType() == ShiftedLognormal, |
53 | 0 | "BlackSwaptionEngine requires (shifted) lognormal input " |
54 | 0 | "volatility"); |
55 | 0 | } |
56 | | |
57 | | |
58 | | BachelierSwaptionEngine::BachelierSwaptionEngine( |
59 | | const Handle<YieldTermStructure> &discountCurve, Volatility vol, |
60 | | const DayCounter &dc, CashAnnuityModel model) |
61 | 0 | : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol, |
62 | 0 | dc, model) {} |
63 | | |
64 | | BachelierSwaptionEngine::BachelierSwaptionEngine( |
65 | | const Handle<YieldTermStructure> &discountCurve, |
66 | | const Handle<Quote> &vol, const DayCounter &dc, CashAnnuityModel model) |
67 | 0 | : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol, |
68 | 0 | dc, model) {} |
69 | | |
70 | | BachelierSwaptionEngine::BachelierSwaptionEngine( |
71 | | const Handle<YieldTermStructure> &discountCurve, |
72 | | const Handle<SwaptionVolatilityStructure> &vol, CashAnnuityModel model) |
73 | 0 | : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol, |
74 | 0 | model) { |
75 | | QL_REQUIRE(vol->volatilityType() == Normal, |
76 | 0 | "BachelierSwaptionEngine requires normal input volatility"); |
77 | 0 | } |
78 | | |
79 | | } // namespace QuantLib |