Computes the integral of a one-dimensional function using adaptive Gauss-Lobatto quadrature. More...
#include <mitsuba/core/quad.h>
Public Types | |
| typedef boost::function< Float(Float)> | Integrand |
Public Member Functions | |
| GaussLobattoIntegrator (size_t maxEvals, Float absError=0, Float relError=0, bool useConvergenceEstimate=true, bool warn=true) | |
| Float | integrate (const Integrand &f, Float a, Float b, size_t *evals=NULL) const |
Integrate the function f from a to b. More... | |
Protected Member Functions | |
| Float | adaptiveGaussLobattoStep (const boost::function< Float(Float)> &f, Float a, Float b, Float fa, Float fb, Float is, size_t &evals) const |
| Perform one step of the 4-point Gauss-Lobatto rule, then compute the same integral using a 7-point Kronrod extension and compare. If the accuracy is deemed too low, recurse. More... | |
| Float | calculateAbsTolerance (const boost::function< Float(Float)> &f, Float a, Float b, size_t &evals) const |
Protected Attributes | |
| Float | m_absError |
| Float | m_relError |
| size_t | m_maxEvals |
| bool | m_useConvergenceEstimate |
| bool | m_warn |
Static Protected Attributes | |
| static const Float | m_alpha |
| static const Float | m_beta |
| static const Float | m_x1 |
| static const Float | m_x2 |
| static const Float | m_x3 |
Computes the integral of a one-dimensional function using adaptive Gauss-Lobatto quadrature.
Given a target error \( \epsilon \), the integral of a function \( f \) between \( a \) and \( b \) is calculated by means of the Gauss-Lobatto formula.
References: This algorithm is a C++ implementation of the algorithm outlined in
W. Gander and W. Gautschi, Adaptive Quadrature - Revisited. BIT, 40(1):84-101, March 2000. CS technical report: ftp.inf.ethz.ch/pub/publications/tech-reports/3xx/306.ps.gz
The original MATLAB version can be downloaded here http://www.inf.ethz.ch/personal/gander/adaptlob.m
This particular implementation is based on code in QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/
| typedef boost::function<Float (Float)> mitsuba::GaussLobattoIntegrator::Integrand |
| mitsuba::GaussLobattoIntegrator::GaussLobattoIntegrator | ( | size_t | maxEvals, |
| Float | absError = 0, |
||
| Float | relError = 0, |
||
| bool | useConvergenceEstimate = true, |
||
| bool | warn = true |
||
| ) |
Initialize a Gauss-Lobatto integration scheme
| maxEvals | Maximum number of function evaluations. The integrator will print a warning when this limit is exceeded. It will then stop the recursion, but a few further evaluations may still take place. Hence the limit is not a strict one. |
| absError | Absolute error requirement (0 to disable) |
| relError | Relative error requirement (0 to disable) |
| useConvergenceEstimate | Estimate the convergence behavior of the GL-quadrature by comparing the 4, 7 and 13-point variants and increase the absolute tolerance accordingly. |
| warn | Should the integrator warn when the number of function evaluations is exceeded? |
|
protected |
Perform one step of the 4-point Gauss-Lobatto rule, then compute the same integral using a 7-point Kronrod extension and compare. If the accuracy is deemed too low, recurse.
| f | Function to integrate |
| a | Lower integration limit |
| b | Upper integration limit |
| fa | Function evaluated at the lower limit |
| fb | Function evaluated at the upper limit |
| is | Absolute tolerance in epsilons |
|
protected |
Compute the absolute error tolerance using a 13-point Gauss-Lobatto rule.
| Float mitsuba::GaussLobattoIntegrator::integrate | ( | const Integrand & | f, |
| Float | a, | ||
| Float | b, | ||
| size_t * | evals = NULL |
||
| ) | const |
Integrate the function f from a to b.
Also returns the total number of evaluations if requested
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |