QuantLib
A free/open-source library for quantitative finance
Fully annotated sources - version 1.22
blackswaptionengine.cpp
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  <http://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 
31  const Handle<YieldTermStructure> &discountCurve,
32  Volatility vol, const DayCounter &dc,
33  Real displacement, CashAnnuityModel model)
34  : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol, dc,
35  displacement, model) {}
36 
38  const Handle<YieldTermStructure> &discountCurve,
39  const Handle<Quote> &vol,
40  const DayCounter &dc,
41  Real displacement,
42  CashAnnuityModel model)
43  : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol, dc,
44  displacement, model) {}
45 
47  const Handle<YieldTermStructure> &discountCurve,
49  CashAnnuityModel model)
50  : detail::BlackStyleSwaptionEngine<detail::Black76Spec>(discountCurve, vol,
51  model) {
52  QL_REQUIRE(vol->volatilityType() == ShiftedLognormal,
53  "BlackSwaptionEngine requires (shifted) lognormal input "
54  "volatility");
55  }
56 
57 
59  const Handle<YieldTermStructure> &discountCurve, Volatility vol,
60  const DayCounter &dc, CashAnnuityModel model)
61  : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol,
62  dc, model) {}
63 
65  const Handle<YieldTermStructure> &discountCurve,
66  const Handle<Quote> &vol, const DayCounter &dc, CashAnnuityModel model)
67  : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol,
68  dc, model) {}
69 
71  const Handle<YieldTermStructure> &discountCurve,
73  : detail::BlackStyleSwaptionEngine<detail::BachelierSpec>(discountCurve, vol,
74  model) {
75  QL_REQUIRE(vol->volatilityType() == Normal,
76  "BachelierSwaptionEngine requires normal input volatility");
77  }
78 
79 } // namespace QuantLib
QuantLib::Handle< YieldTermStructure >
QuantLib::BlackSwaptionEngine::BlackSwaptionEngine
BlackSwaptionEngine(const Handle< YieldTermStructure > &discountCurve, Volatility vol, const DayCounter &dc=Actual365Fixed(), Real displacement=0.0, CashAnnuityModel model=DiscountCurve)
Definition: blackswaptionengine.cpp:30
QuantLib::Volatility
Real Volatility
volatility
Definition: types.hpp:78
QuantLib::Normal
@ Normal
Definition: volatilitytype.hpp:32
QuantLib::BachelierSwaptionEngine::BachelierSwaptionEngine
BachelierSwaptionEngine(const Handle< YieldTermStructure > &discountCurve, Volatility vol, const DayCounter &dc=Actual365Fixed(), CashAnnuityModel model=DiscountCurve)
Definition: blackswaptionengine.cpp:58
QuantLib::detail::BlackStyleSwaptionEngine< detail::Black76Spec >::CashAnnuityModel
CashAnnuityModel
Definition: blackswaptionengine.hpp:56
QuantLib::DayCounter
day counter class
Definition: daycounter.hpp:44
QuantLib::ShiftedLognormal
@ ShiftedLognormal
Definition: volatilitytype.hpp:32
QuantLib
Definition: cashflow.cpp:25
QuantLib::Real
QL_REAL Real
real number
Definition: types.hpp:50