QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
fdm3dimsolver.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) 2011 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 fdm3dimsolver.hpp
21*/
22
23#ifndef quantlib_fdm_3_dim_solver_hpp
24#define quantlib_fdm_3_dim_solver_hpp
25
26#include <ql/math/matrix.hpp>
30
31
32namespace QuantLib {
33
34 class BicubicSpline;
35 class FdmSnapshotCondition;
36
37 class Fdm3DimSolver : public LazyObject {
38 public:
39 Fdm3DimSolver(const FdmSolverDesc& solverDesc,
40 const FdmSchemeDesc& schemeDesc,
41 ext::shared_ptr<FdmLinearOpComposite> op);
42
43 void performCalculations() const override;
44
45 Real interpolateAt(Real x, Real y, Rate z) const;
46 Real thetaAt(Real x, Real y, Rate z) const;
47
48 private:
51 const ext::shared_ptr<FdmLinearOpComposite> op_;
52
53 const ext::shared_ptr<FdmSnapshotCondition> thetaCondition_;
54 const ext::shared_ptr<FdmStepConditionComposite> conditions_;
55
56 std::vector<Real> x_, y_, z_, initialValues_;
57 mutable std::vector<Matrix> resultValues_;
58 mutable std::vector<ext::shared_ptr<BicubicSpline> > interpolation_;
59 };
60}
61
62#endif
void performCalculations() const override
std::vector< Real > initialValues_
std::vector< Matrix > resultValues_
const ext::shared_ptr< FdmStepConditionComposite > conditions_
const ext::shared_ptr< FdmSnapshotCondition > thetaCondition_
std::vector< Real > z_
Real interpolateAt(Real x, Real y, Rate z) const
const FdmSolverDesc solverDesc_
std::vector< Real > y_
Real thetaAt(Real x, Real y, Rate z) const
std::vector< ext::shared_ptr< BicubicSpline > > interpolation_
std::vector< Real > x_
const ext::shared_ptr< FdmLinearOpComposite > op_
const FdmSchemeDesc schemeDesc_
Framework for calculation on demand and result caching.
Definition: lazyobject.hpp:35
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
framework for calculation on demand and result caching
matrix used in linear algebra.
Definition: any.hpp:35