Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::GaussLobattoIntegrator Class Reference

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
 

Detailed Description

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/

Member Typedef Documentation

Constructor & Destructor Documentation

mitsuba::GaussLobattoIntegrator::GaussLobattoIntegrator ( size_t  maxEvals,
Float  absError = 0,
Float  relError = 0,
bool  useConvergenceEstimate = true,
bool  warn = true 
)

Initialize a Gauss-Lobatto integration scheme

Parameters
maxEvalsMaximum 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.
absErrorAbsolute error requirement (0 to disable)
relErrorRelative error requirement (0 to disable)
useConvergenceEstimateEstimate the convergence behavior of the GL-quadrature by comparing the 4, 7 and 13-point variants and increase the absolute tolerance accordingly.
warnShould the integrator warn when the number of function evaluations is exceeded?

Member Function Documentation

Float mitsuba::GaussLobattoIntegrator::adaptiveGaussLobattoStep ( const boost::function< Float(Float)> &  f,
Float  a,
Float  b,
Float  fa,
Float  fb,
Float  is,
size_t &  evals 
) const
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.

Parameters
fFunction to integrate
aLower integration limit
bUpper integration limit
faFunction evaluated at the lower limit
fbFunction evaluated at the upper limit
isAbsolute tolerance in epsilons
Float mitsuba::GaussLobattoIntegrator::calculateAbsTolerance ( const boost::function< Float(Float)> &  f,
Float  a,
Float  b,
size_t &  evals 
) const
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

Member Data Documentation

Float mitsuba::GaussLobattoIntegrator::m_absError
protected
const Float mitsuba::GaussLobattoIntegrator::m_alpha
staticprotected
const Float mitsuba::GaussLobattoIntegrator::m_beta
staticprotected
size_t mitsuba::GaussLobattoIntegrator::m_maxEvals
protected
Float mitsuba::GaussLobattoIntegrator::m_relError
protected
bool mitsuba::GaussLobattoIntegrator::m_useConvergenceEstimate
protected
bool mitsuba::GaussLobattoIntegrator::m_warn
protected
const Float mitsuba::GaussLobattoIntegrator::m_x1
staticprotected
const Float mitsuba::GaussLobattoIntegrator::m_x2
staticprotected
const Float mitsuba::GaussLobattoIntegrator::m_x3
staticprotected

The documentation for this class was generated from the following file: