QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
volatilityinterpolationspecifierabcd.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Mark Joshi
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
20#ifndef volatility_interpolation_specifier_abcd_hpp
21#define volatility_interpolation_specifier_abcd_hpp
22
25#include <ql/types.hpp>
26#include <ql/shared_ptr.hpp>
27#include <vector>
28
29
30namespace QuantLib
31{
33 {
34 public:
36 Size offset,
37 const std::vector< PiecewiseConstantAbcdVariance>& originalVariances, // these should be associated with the long rates
38 const std::vector<Time>& timesForSmallRates, // these should be associated with the shorter rates
39 Real lastCapletVol=0.0
40 );
41
43 void setScalingFactors(const std::vector<Real>& scales) override;
44 void setLastCapletVol(Real vol) override;
45
46
47 const std::vector<ext::shared_ptr<PiecewiseConstantVariance> >&
48 interpolatedVariances() const override;
49 const std::vector<ext::shared_ptr<PiecewiseConstantVariance> >&
50 originalVariances() const override;
51
52 Size getPeriod() const override;
53 Size getOffset() const override;
54 Size getNoBigRates() const override;
55 Size getNoSmallRates() const override;
56
57 private:
60
61 std::vector<ext::shared_ptr<PiecewiseConstantVariance> > interpolatedVariances_;
62 std::vector<ext::shared_ptr<PiecewiseConstantVariance> > originalVariances_;
63 std::vector< PiecewiseConstantAbcdVariance> originalABCDVariances_;
64 std::vector< PiecewiseConstantAbcdVariance> originalABCDVariancesScaled_;
66 std::vector<Time> timesForSmallRates_;
67 std::vector<Real> scalingFactors_;
68
71
72 void recompute();
73
74 };
75}
76
77#endif
std::vector< PiecewiseConstantAbcdVariance > originalABCDVariances_
void setScalingFactors(const std::vector< Real > &scales) override
std::vector< PiecewiseConstantAbcdVariance > originalABCDVariancesScaled_
std::vector< ext::shared_ptr< PiecewiseConstantVariance > > interpolatedVariances_
const std::vector< ext::shared_ptr< PiecewiseConstantVariance > > & interpolatedVariances() const override
const std::vector< ext::shared_ptr< PiecewiseConstantVariance > > & originalVariances() const override
std::vector< ext::shared_ptr< PiecewiseConstantVariance > > originalVariances_
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
Maps shared_ptr to either the boost or std implementation.
Custom types.