Represents a numerical integrator that uses an adaptive algorithm based on a Gauss-Kronrod integration rule.

Namespace: Extreme.Mathematics.Calculus
Assembly: Extreme.Numerics (Extreme.Numerics)

Syntax

Visual Basic (Declaration)
Public Class AdaptiveIntegrator _
	Inherits NumericalIntegrator
C#
public class AdaptiveIntegrator : NumericalIntegrator
C++
public ref class AdaptiveIntegrator : public NumericalIntegrator

Methods

IconTypeDescription
Equals(Object)
Determines whether the specified Object is equal to the current Object.
Finalize()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetHashCode()
Serves as a hash function for a particular type.
GetSingularities()
Returns an array of Double values containing the locations of singularities of the integrand inside the integration interval.
GetType()
Gets the Type of the current instance.
IncrementEvaluations()
Increments the number of evaluations by one.
IncrementEvaluations(Int32)
Increments the number of evaluations by the specified amount.
Integrate()
Numerically integrates a function of one variable.
Integrate(RealFunction, Double, Double, Double[]())
Numerically integrates a function of one variable.
Integrate(Double, Double)
Numerically integrates a function of one variable.
Integrate(RealFunction, Double, Double)
Numerically integrates a function of one variable.
MemberwiseClone()
Creates a shallow copy of the current Object.
SetResultProperties(Object, Double, AlgorithmStatus, Int32)
Sets the results of an algorithm's execution.
SetResultProperties(Object, Double)
Sets the results of an algorithm's execution.
SetSingularities(Double[]())
Sets the locations of singularities of the integrand inside the integration interval.
ThrowException()
Interprets the AlgorithmStatus and throws the appropriate exception.
ToString()
Returns a String that represents the current Object.

Constructors

IconTypeDescription
AdaptiveIntegratorNew(RealFunction, Double, Double)
Constructs a new AdaptiveIntegrator object.
AdaptiveIntegratorNew(RealFunction, Double[]())
Constructs a new AdaptiveIntegrator object.
AdaptiveIntegratorNew()
Constructs a new AdaptiveIntegrator object.
AdaptiveIntegratorNew(Boolean)
Constructs a new AdaptiveIntegrator object.

Properties

IconTypeDescription
AbsoluteTolerance
Gets or sets the absolute tolerance used in the convergence test.
ConvergenceCriterion
Gets or sets a value specifying the criterion that is to be used in the convergence test for the algorithm.
EstimatedError
Gets a value indicating the size of the absolute error of the result.
EvaluationsNeeded
Gets the number of evaluations needed to execute the algorithm.
EvaluationsRemaining
Gets the number of evaluations still available.
FunctionEvaluationsNeeded
Gets the number of function evaluations performed by the algorithm.
Integrand
Gets or sets the function to integrate.
IntegrationRule
Gets or sets the integration rule to be used to estimate integrals over subintervals.
IterationResultCode
Gets the AlgorithmStatus following an execution of the algorithm.
IterationsNeeded
Gets the number of iterations needed by the algorithm to reach the desired accuracy.
IterationsRemaining
Gets the number of iterations remaining.
LowerBound
Gets or sets the lower bound of the integration interval.
MaxEvaluations
Gets or sets the maximum number of evaluations during the calculation.
MaxIterations
Gets or sets the maximum number of iterations to use when approximating the roots of the target function.
Order
Gets the order of the Gauss-Kronrod formula used to calculate the integral on subintervals.
RelativeTolerance
Gets or sets the relative tolerance used in the convergence test.
Result
Gets the result of an algorithm after it has executed.
Status
Gets the AlgorithmStatus following an execution of the algorithm.
ThrowExceptionOnFailure
Gets or sets a value indicating whether to throw an exception when the algorithm fails to converge.
UpperBound
Gets or sets the upper bound of the integration interval.
UseExtrapolation
Gets or sets a value indicating whether precautions should be taken to deal with singularities on the integration interval.

Remarks

The AdaptiveIntegrator class provides the most robust, reliable, and in most cases the fastest numerical integration algorithm. It uses a simple integration rule to approximate the integral over subintervals. In each step, the interval with the largest estimated error is divided in two, and new approximations for these two subintervals are calculated. This process continues until the total estimated error over all intervals is within the desired tolerance.

AdaptiveIntegrator inherits from NumericalIntegrator, the abstract base class for all numerical integration classes. It implements the IterativeAlgorithm interface. All properties of this interface are available. The AbsoluteTolerance and RelativeTolerance properties set the desired precision as specified by the ConvergenceCriterion property. The default value for both tolerances is SqrtEpsilon (roughly 10-8). MaxIterations sets the maximum number of iterations, which in this case is the maximum number of subintervals. The default value for this property is 5000. IterationsNeeded returns the actual number of iterations performed after the algorithm has completed.

The Integrate() method does the actual work of numerically integrating an integrand. It takes three parameters. The first parameter is a RealFunction delegate that specifies the function to integrate. The second and third parameters are Double values that specify the lower and upper bounds of the integration interval.

The IntegrationRule property lets you specify which Gauss-Kronrod integration rule to use to approximate integrals on a subinterval. The default is the GaussKronrodIntegrator31 for normal integrands, and the GaussKronrodIntegrator15 when singularities are expected, and when integrating over infinite intervals. For oscillating target functions, the higher order rules will tend to give better results.

Several enhancements make this the integration algorithm of choice, especially for 'difficult' target functions.

An extra property, UseExtrapolation, lets you specify whether special precautions should be taken to deal with singularities. If UseExtrapolation is true, an extrapolation algorithm is used to approximate the integral near a singularity or singularities. Because this option requires extra resources, it is recommended only for integrands that actually have singularities inside or at the boundaries of the integration interval.

The SetSingularities(Double[]()) and GetSingularities() methods let you specify and retrieve the points inside the integration interval where the integrand has a singularity or a discontinuity. They are returned as a Double array containing the problem points. Extrapolation is used once again to approximate the integral near the singularity or singularities. Specifying the problem points in the target function can lead to speed-ups of several orders of magnitude.

Unlike other classes, this integrator can deal successfully with infinite integration intervals. Specify NegativeInfinity or PositiveInfinity for one or both bounds of the integration interval. Internally, the class transforms the infinite interval to a finite interval, and performs the integration of the transformed target function over the transformed interval.

Inheritance Hierarchy

System.Object
  Extreme.Mathematics.IterativeAlgorithm
    Extreme.Mathematics.Calculus.NumericalIntegrator
      Extreme.Mathematics.Calculus.AdaptiveIntegrator