QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
methods
finitedifferences
meshers
fdm1dmesher.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) 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
22
/*! \file fdm1dmesher.hpp
23
\brief One-dimensional simple FDM mesher object working on an index
24
*/
25
26
#ifndef quantlib_fdm_1d_mesher_hpp
27
#define quantlib_fdm_1d_mesher_hpp
28
29
#include <
ql/types.hpp
>
30
#include <vector>
31
32
namespace
QuantLib
{
33
34
class
Fdm1dMesher
{
35
public
:
36
explicit
Fdm1dMesher
(
Size
size
)
37
:
locations_
(
size
),
dplus_
(
size
),
dminus_
(
size
) {}
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
QuantLib::Fdm1dMesher
Definition:
fdm1dmesher.hpp:34
QuantLib::Fdm1dMesher::locations_
std::vector< Real > locations_
Definition:
fdm1dmesher.hpp:47
QuantLib::Fdm1dMesher::dminus
Real dminus(Size index) const
Definition:
fdm1dmesher.hpp:42
QuantLib::Fdm1dMesher::location
Real location(Size index) const
Definition:
fdm1dmesher.hpp:43
QuantLib::Fdm1dMesher::locations
const std::vector< Real > & locations() const
Definition:
fdm1dmesher.hpp:44
QuantLib::Fdm1dMesher::~Fdm1dMesher
virtual ~Fdm1dMesher()=default
QuantLib::Fdm1dMesher::Fdm1dMesher
Fdm1dMesher(Size size)
Definition:
fdm1dmesher.hpp:36
QuantLib::Fdm1dMesher::dplus_
std::vector< Real > dplus_
Definition:
fdm1dmesher.hpp:48
QuantLib::Fdm1dMesher::size
Size size() const
Definition:
fdm1dmesher.hpp:40
QuantLib::Fdm1dMesher::dminus_
std::vector< Real > dminus_
Definition:
fdm1dmesher.hpp:48
QuantLib::Fdm1dMesher::dplus
Real dplus(Size index) const
Definition:
fdm1dmesher.hpp:41
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Size
std::size_t Size
size of a container
Definition:
types.hpp:58
QuantLib
Definition:
any.hpp:35
types.hpp
Custom types.
Generated by
Doxygen
1.9.5