QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdm1dmesher.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Andreas Gaida
5 Copyright (C) 2008 Ralph Schreyer
6 Copyright (C) 2008 Klaus Spanderen
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_fdm_1d_mesher_hpp
27#define quantlib_fdm_1d_mesher_hpp
28
29#include <ql/types.hpp>
30#include <vector>
31
32namespace QuantLib {
33
35 public:
38 virtual ~Fdm1dMesher() = default;
39
40 Size size() const { return locations_.size(); }
41 Real dplus(Size index) const {return dplus_[index];}
42 Real dminus(Size index) const {return dminus_[index];}
43 Real location(Size index) const {return locations_[index];}
44 const std::vector<Real>& locations() const {return locations_;}
45
46 protected:
47 std::vector<Real> locations_;
48 std::vector<Real> dplus_, dminus_;
49 };
50}
51
52#endif
std::vector< Real > locations_
Definition: fdm1dmesher.hpp:47
Real dminus(Size index) const
Definition: fdm1dmesher.hpp:42
Real location(Size index) const
Definition: fdm1dmesher.hpp:43
const std::vector< Real > & locations() const
Definition: fdm1dmesher.hpp:44
virtual ~Fdm1dMesher()=default
std::vector< Real > dplus_
Definition: fdm1dmesher.hpp:48
std::vector< Real > dminus_
Definition: fdm1dmesher.hpp:48
Real dplus(Size index) const
Definition: fdm1dmesher.hpp:41
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