QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
kronrodintegral.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 François du Vignaud
5 Copyright (C) 2003 Niels Elken Sønderby
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_kronrod_integral_hpp
26#define quantlib_kronrod_integral_hpp
27
28#include <ql/errors.hpp>
29#include <ql/types.hpp>
30#include <ql/utilities/null.hpp>
31#include <ql/math/integrals/integral.hpp>
32#include <ql/functional.hpp>
33
34namespace QuantLib {
35
37
53 public:
58 Real relativeAccuracy() const;
59 protected:
60 Real integrate(const ext::function<Real(Real)>& f, Real a, Real b) const override;
61
62 private:
64 };
65
67
86 public:
87 explicit GaussKronrodAdaptive(Real tolerance,
88 Size maxFunctionEvaluations = Null<Size>());
89 protected:
90 Real integrate(const ext::function<Real(Real)>& f, Real a, Real b) const override;
91
92 private:
93 Real integrateRecursively(const ext::function<Real (Real)>& f,
94 Real a,
95 Real b,
96 Real tolerance) const;
97 };
98}
99
100#endif
Integral of a 1-dimensional function using the Gauss-Kronrod methods.
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Real integrateRecursively(const ext::function< Real(Real)> &f, Real a, Real b, Real tolerance) const
Integral of a 1-dimensional function using the Gauss-Kronrod methods.
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Real absoluteAccuracy() const
Definition: integral.cpp:43
Size maxEvaluations() const
Definition: integral.cpp:47
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