Top Description Constructors Methods
org.apache.commons.math3.analysis.integration.gauss

public Class SymmetricGaussIntegrator

extends GaussIntegrator
Class Inheritance
Imports
org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.exception.DimensionMismatchException, .NonMonotonicSequenceException, org.apache.commons.math3.util.Pair

This class's implements integrate method assuming that the integral is symmetric about 0. This allows to reduce numerical errors.
Since
3.3

Constructor Summary

AccessConstructor and Description
public
SymmetricGaussIntegrator(double[]
Integration points.
points
,
double[]
Weights of the corresponding integration nodes.
weights
)

Creates an integrator from the given points and weights.

public
SymmetricGaussIntegrator(Pair<double[], double[]>
Integration points and corresponding weights.
pointsAndWeights
)

Creates an integrator from the given pair of points (first element of the pair) and weights (second element of the pair.

Method Summary

Modifier and TypeMethod and Description
public double
integrate(UnivariateFunction
Function to integrate.
f
)

Overrides org.apache.commons.math3.analysis.integration.gauss.GaussIntegrator.integrate.

Returns an estimate of the integral of f(x) * w(x), where w is a weight function that depends on the actual flavor of the Gauss integration scheme.

Inherited from org.apache.commons.math3.analysis.integration.gauss.GaussIntegrator:
getNumberOfPointsgetPointgetWeight

Constructor Detail

SymmetricGaussIntegratorback to summary
public SymmetricGaussIntegrator(double[] points, double[] weights) throws NonMonotonicSequenceException, DimensionMismatchException

Creates an integrator from the given points and weights. The integration interval is defined by the first and last value of points which must be sorted in increasing order.

Parameters
points:double[]

Integration points.

weights:double[]

Weights of the corresponding integration nodes.

Exceptions
NonMonotonicSequenceException:
if the points are not sorted in increasing order.
DimensionMismatchException:
if points and weights don't have the same length
SymmetricGaussIntegratorback to summary
public SymmetricGaussIntegrator(Pair<double[], double[]> pointsAndWeights) throws NonMonotonicSequenceException

Creates an integrator from the given pair of points (first element of the pair) and weights (second element of the pair.

Parameters
pointsAndWeights:Pair<double[], double[]>

Integration points and corresponding weights.

Exceptions
NonMonotonicSequenceException:
if the points are not sorted in increasing order.
See Also
SymmetricGaussIntegrator(double[], double[])

Method Detail

integrateback to summary
public double integrate(UnivariateFunction f)

Overrides org.apache.commons.math3.analysis.integration.gauss.GaussIntegrator.integrate.

Doc from org.apache.commons.math3.analysis.integration.gauss.GaussIntegrator.integrate.

Returns an estimate of the integral of f(x) * w(x), where w is a weight function that depends on the actual flavor of the Gauss integration scheme. The algorithm uses the points and associated weights, as passed to the constructor.

Parameters
f:UnivariateFunction

Function to integrate.

Returns:double

the integral of the weighted function.

Annotations
@Override