QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
GaussKronrodAdaptive Class Reference

Integral of a 1-dimensional function using the Gauss-Kronrod methods. More...

#include <kronrodintegral.hpp>

+ Inheritance diagram for GaussKronrodAdaptive:
+ Collaboration diagram for GaussKronrodAdaptive:

Public Member Functions

 GaussKronrodAdaptive (Real tolerance, Size maxFunctionEvaluations=Null< Size >())
 
- Public Member Functions inherited from Integrator
 Integrator (Real absoluteAccuracy, Size maxEvaluations)
 
virtual ~Integrator ()=default
 
Real operator() (const ext::function< Real(Real)> &f, Real a, Real b) const
 
void setAbsoluteAccuracy (Real)
 
void setMaxEvaluations (Size)
 
Real absoluteAccuracy () const
 
Size maxEvaluations () const
 
Real absoluteError () const
 
Size numberOfEvaluations () const
 
virtual bool integrationSuccess () const
 

Protected Member Functions

Real integrate (const ext::function< Real(Real)> &f, Real a, Real b) const override
 
- Protected Member Functions inherited from Integrator
void setAbsoluteError (Real error) const
 
void setNumberOfEvaluations (Size evaluations) const
 
void increaseNumberOfEvaluations (Size increase) const
 

Private Member Functions

Real integrateRecursively (const ext::function< Real(Real)> &f, Real a, Real b, Real tolerance) const
 

Detailed Description

Integral of a 1-dimensional function using the Gauss-Kronrod methods.

This class provide an adaptive integration procedure using 15 points Gauss-Kronrod integration rule. This is more robust in that it allows to integrate less smooth functions (though singular functions should be integrated using dedicated algorithms) but less efficient beacuse it does not reuse precedently computed points during computation steps.

References:

Gauss-Kronrod Integration http://mathcssun1.emporia.edu/~oneilcat/ExperimentApplet3/ExperimentApplet3.html

NMS - Numerical Analysis Library http://www.math.iastate.edu/burkardt/f_src/nms/nms.html

Tests:
the correctness of the result is tested by checking it against known good values.

Definition at line 85 of file kronrodintegral.hpp.

Constructor & Destructor Documentation

◆ GaussKronrodAdaptive()

GaussKronrodAdaptive ( Real  tolerance,
Size  maxFunctionEvaluations = Null<Size>() 
)
explicit

Definition at line 442 of file kronrodintegral.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ integrate()

Real integrate ( const ext::function< Real(Real)> &  f,
Real  a,
Real  b 
) const
overrideprotectedvirtual

Implements Integrator.

Definition at line 354 of file kronrodintegral.cpp.

+ Here is the call graph for this function:

◆ integrateRecursively()

Real integrateRecursively ( const ext::function< Real(Real)> &  f,
Real  a,
Real  b,
Real  tolerance 
) const
private

Definition at line 386 of file kronrodintegral.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: