QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdsimpleextoustorageengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2011 Klaus Spanderen
5 Copyright (C) 2014 Ralph Schreyer
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_fd_simple_ext_ou_storage_engine_hpp
26#define quantlib_fd_simple_ext_ou_storage_engine_hpp
27
28#include <ql/pricingengine.hpp>
29#include <ql/instruments/vanillastorageoption.hpp>
30#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
31
32namespace QuantLib {
33
34 class ExtendedOrnsteinUhlenbeckProcess;
35 class YieldTermStructure;
36
38 : public GenericEngine<VanillaStorageOption::arguments,
39 VanillaStorageOption::results> {
40 public:
41 typedef std::vector<std::pair<Time, Real> > Shape;
42
43
44 FdSimpleExtOUStorageEngine(ext::shared_ptr<ExtendedOrnsteinUhlenbeckProcess> p,
45 ext::shared_ptr<YieldTermStructure> rTS,
46 Size tGrid = 50,
47 Size xGrid = 100,
48 Size yGrid = Null<Size>(),
49 ext::shared_ptr<Shape> shape = ext::shared_ptr<Shape>(),
50 const FdmSchemeDesc& schemeDesc = FdmSchemeDesc::Douglas());
51
52 void calculate() const override;
53
54 private:
55 const ext::shared_ptr<ExtendedOrnsteinUhlenbeckProcess> process_;
56 const ext::shared_ptr<YieldTermStructure> rTS_;
58 const ext::shared_ptr<Shape> shape_;
60 };
61}
62
63#endif
std::vector< std::pair< Time, Real > > Shape
const ext::shared_ptr< YieldTermStructure > rTS_
const ext::shared_ptr< ExtendedOrnsteinUhlenbeckProcess > process_
template base class for option pricing engines
template class providing a null value for a given type.
Definition: null.hpp:76
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
static FdmSchemeDesc Douglas()