QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
strippedoptionletadapter.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Giorgio Facchinetti
5 Copyright (C) 2007 Katiuscia Manzoni
6 Copyright (C) 2015 Peter Caspers
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
26#ifndef quantlib_stripped_optionlet_adapter_h
27#define quantlib_stripped_optionlet_adapter_h
28
29#include <ql/termstructures/volatility/optionlet/strippedoptionletbase.hpp>
30#include <ql/termstructures/volatility/optionlet/optionletstripper.hpp>
31#include <ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp>
32#include <ql/math/interpolation.hpp>
33#include <ql/math/interpolations/sabrinterpolation.hpp>
34
35namespace QuantLib {
36
41 public LazyObject {
42 public:
44 const ext::shared_ptr<StrippedOptionletBase>&);
45
47
48 Date maxDate() const override;
50
52 Rate minStrike() const override;
53 Rate maxStrike() const override;
55
57 void update() override;
58 void performCalculations() const override;
59 ext::shared_ptr<OptionletStripper> optionletStripper() const;
61
63 void deepUpdate() override;
65
66 VolatilityType volatilityType() const override;
67 Real displacement() const override;
68
69 protected:
71
72 ext::shared_ptr<SmileSection> smileSectionImpl(Time optionTime) const override;
73 Volatility volatilityImpl(Time length, Rate strike) const override;
75 private:
76 const ext::shared_ptr<StrippedOptionletBase> optionletStripper_;
78 mutable std::vector<ext::shared_ptr<Interpolation> > strikeInterpolations_;
79 };
80
84 }
85
87 optionletStripper_->update();
88 update();
89 }
90
91 inline ext::shared_ptr< OptionletStripper >
93 return ext::dynamic_pointer_cast< OptionletStripper >(
95 }
96}
97
98#endif
Concrete date class.
Definition: date.hpp:125
Framework for calculation on demand and result caching.
Definition: lazyobject.hpp:35
void update() override
Definition: lazyobject.hpp:188
Optionlet (caplet/floorlet) volatility structure.
const ext::shared_ptr< StrippedOptionletBase > optionletStripper_
ext::shared_ptr< OptionletStripper > optionletStripper() const
Rate maxStrike() const override
the maximum strike for which the term structure can return vols
Rate minStrike() const override
the minimum strike for which the term structure can return vols
ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime) const override
implements the actual smile calculation in derived classes
VolatilityType volatilityType() const override
Volatility volatilityImpl(Time length, Rate strike) const override
implements the actual volatility calculation in derived classes
Date maxDate() const override
the latest date for which the curve can return values
std::vector< ext::shared_ptr< Interpolation > > strikeInterpolations_
void update() override
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35