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 Attributes | List of all members
GaussKronrodNonAdaptive Class Reference

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

#include <kronrodintegral.hpp>

+ Inheritance diagram for GaussKronrodNonAdaptive:
+ Collaboration diagram for GaussKronrodNonAdaptive:

Public Member Functions

 GaussKronrodNonAdaptive (Real absoluteAccuracy, Size maxEvaluations, Real relativeAccuracy)
 
void setRelativeAccuracy (Real)
 
Real relativeAccuracy () const
 
- 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 Attributes

Real relativeAccuracy_
 

Detailed Description

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

This class provide a non-adaptive integration procedure which uses fixed Gauss-Kronrod abscissae to sample the integrand at a maximum of 87 points. It is provided for fast integration of smooth functions.

This function applies the Gauss-Kronrod 10-point, 21-point, 43-point and 87-point integration rules in succession until an estimate of the integral of f over (a, b) is achieved within the desired absolute and relative error limits, epsabs and epsrel. The function returns the final approximation, result, an estimate of the absolute error, abserr and the number of function evaluations used, neval. The Gauss-Kronrod rules are designed in such a way that each rule uses all the results of its predecessors, in order to minimize the total number of function evaluations.

Definition at line 52 of file kronrodintegral.hpp.

Constructor & Destructor Documentation

◆ GaussKronrodNonAdaptive()

GaussKronrodNonAdaptive ( Real  absoluteAccuracy,
Size  maxEvaluations,
Real  relativeAccuracy 
)

Definition at line 227 of file kronrodintegral.cpp.

Member Function Documentation

◆ setRelativeAccuracy()

void setRelativeAccuracy ( Real  relativeAccuracy)

Definition at line 218 of file kronrodintegral.cpp.

+ Here is the call graph for this function:

◆ relativeAccuracy()

Real relativeAccuracy ( ) const

Definition at line 223 of file kronrodintegral.cpp.

+ Here is the caller graph for this function:

◆ integrate()

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

Implements Integrator.

Definition at line 234 of file kronrodintegral.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ relativeAccuracy_

Real relativeAccuracy_
private

Definition at line 63 of file kronrodintegral.hpp.