QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
gaussian1dswaptionengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2013 Peter Caspers
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 <http://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
24#ifndef quantlib_pricers_gaussian1d_swaption_hpp
25#define quantlib_pricers_gaussian1d_swaption_hpp
26
27#include <ql/instruments/swaption.hpp>
28#include <ql/models/shortrate/onefactormodels/gaussian1dmodel.hpp>
29#include <ql/pricingengines/genericmodelengine.hpp>
30#include <utility>
31
32namespace QuantLib {
33
35
45 : public GenericModelEngine<Gaussian1dModel, Swaption::arguments,
46 Swaption::results> {
47 public:
52 };
53
55 const ext::shared_ptr<Gaussian1dModel>& model,
56 const int integrationPoints = 64,
57 const Real stddevs = 7.0,
58 const bool extrapolatePayoff = true,
59 const bool flatPayoffExtrapolation = false,
61 const Probabilities probabilities = None)
63 integrationPoints_(integrationPoints), stddevs_(stddevs),
64 extrapolatePayoff_(extrapolatePayoff), flatPayoffExtrapolation_(flatPayoffExtrapolation),
65 discountCurve_(std::move(discountCurve)), probabilities_(probabilities) {
66
67 if (!discountCurve_.empty())
69 }
70
72 const Handle<Gaussian1dModel>& model,
73 const int integrationPoints = 64,
74 const Real stddevs = 7.0,
75 const bool extrapolatePayoff = true,
76 const bool flatPayoffExtrapolation = false,
78 const Probabilities probabilities = None)
80 integrationPoints_(integrationPoints), stddevs_(stddevs),
81 extrapolatePayoff_(extrapolatePayoff), flatPayoffExtrapolation_(flatPayoffExtrapolation),
82 discountCurve_(std::move(discountCurve)), probabilities_(probabilities) {
83
84 if (!discountCurve_.empty())
86 }
87
88 void calculate() const override;
89
90 private:
96 };
97}
98
99#endif
One factor model swaption engine.
const Handle< YieldTermStructure > discountCurve_
Gaussian1dSwaptionEngine(const Handle< Gaussian1dModel > &model, const int integrationPoints=64, const Real stddevs=7.0, const bool extrapolatePayoff=true, const bool flatPayoffExtrapolation=false, Handle< YieldTermStructure > discountCurve=Handle< YieldTermStructure >(), const Probabilities probabilities=None)
Gaussian1dSwaptionEngine(const ext::shared_ptr< Gaussian1dModel > &model, const int integrationPoints=64, const Real stddevs=7.0, const bool extrapolatePayoff=true, const bool flatPayoffExtrapolation=false, Handle< YieldTermStructure > discountCurve=Handle< YieldTermStructure >(), const Probabilities probabilities=None)
Base class for some pricing engine on a particular model.
Shared handle to an observable.
Definition: handle.hpp:41
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
Swaption class
Definition: swaption.hpp:81
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
STL namespace.