QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
vectorbsmprocessextractor.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) 2024 Klaus Spanderen
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/*! \file vectorbsmprocessextractor.hpp
21 \brief helper class to extract underlying, volatility etc from a vector of processes
22*/
23
24#ifndef quantlib_vector_bsm_process_extractor_hpp
25#define quantlib_vector_bsm_process_extractor_hpp
26
28#include <functional>
29
30namespace QuantLib::detail {
31
33 public:
35 std::vector<ext::shared_ptr<GeneralizedBlackScholesProcess> > p);
36
37 Array getSpot() const;
38 Array getBlackStdDev(const Date& maturityDate) const;
39 Array getBlackVariance(const Date& maturityDate) const;
40 Array getDividendYieldDf(const Date& maturityDate) const;
41 DiscountFactor getInterestRateDf(const Date& maturityDate) const;
42
43 private:
45 const std::function<Real(const ext::shared_ptr<GeneralizedBlackScholesProcess>&)>& f) const;
46
47 const std::vector<ext::shared_ptr<GeneralizedBlackScholesProcess> > processes_;
48 };
49
50}
51
52
53#endif
Black-Scholes processes.
1-D array used in linear algebra.
Definition: array.hpp:52
Concrete date class.
Definition: date.hpp:125
Array getBlackStdDev(const Date &maturityDate) const
Array getDividendYieldDf(const Date &maturityDate) const
DiscountFactor getInterestRateDf(const Date &maturityDate) const
Array extractProcesses(const std::function< Real(const ext::shared_ptr< GeneralizedBlackScholesProcess > &)> &f) const
Array getBlackVariance(const Date &maturityDate) const
const std::vector< ext::shared_ptr< GeneralizedBlackScholesProcess > > processes_
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66