QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
gausslobattointegral.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 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
25#ifndef quantlib_gauss_lobatto_integral_hpp
26#define quantlib_gauss_lobatto_integral_hpp
27
28#include <ql/errors.hpp>
29#include <ql/utilities/null.hpp>
30#include <ql/math/integrals/integral.hpp>
31
32namespace QuantLib {
33
35
52 public:
53 GaussLobattoIntegral(Size maxIterations,
54 Real absAccuracy,
55 Real relAccuracy = Null<Real>(),
56 bool useConvergenceEstimate = true);
57
58 protected:
59 Real integrate(const ext::function<Real(Real)>& f, Real a, Real b) const override;
60
61 Real adaptivGaussLobattoStep(const ext::function<Real (Real)>& f,
62 Real a, Real b, Real fa, Real fb,
63 Real is) const;
64 Real calculateAbsTolerance(const ext::function<Real (Real)>& f,
65 Real a, Real b) const;
66
69 const static Real alpha_, beta_, x1_, x2_, x3_;
70 };
71}
72#endif
Integral of a one-dimensional function.
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Real adaptivGaussLobattoStep(const ext::function< Real(Real)> &f, Real a, Real b, Real fa, Real fb, Real is) const
Real calculateAbsTolerance(const ext::function< Real(Real)> &f, Real a, Real b) const
template class providing a null value for a given type.
Definition: null.hpp:76
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