public class SymmetricGaussIntegrator extends GaussIntegrator
integrate
method assuming that the integral is symmetric about 0.
This allows to reduce numerical errors.Constructor | Description |
---|---|
SymmetricGaussIntegrator(double[] points,
double[] weights) |
Creates an integrator from the given
points and weights . |
SymmetricGaussIntegrator(Pair<double[],double[]> pointsAndWeights) |
Creates an integrator from the given pair of points (first element of
the pair) and weights (second element of the pair.
|
Modifier and Type | Method | Description |
---|---|---|
double |
integrate(UnivariateFunction f) |
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. |
getNumberOfPoints, getPoint, getWeight
public SymmetricGaussIntegrator(double[] points, double[] weights) throws MathIllegalArgumentException
points
and weights
.
The integration interval is defined by the first and last value of
points
which must be sorted in increasing order.points
- Integration points.weights
- Weights of the corresponding integration nodes.MathIllegalArgumentException
- if the points
are not
sorted in increasing order.MathIllegalArgumentException
- if points and weights don't have the same lengthpublic SymmetricGaussIntegrator(Pair<double[],double[]> pointsAndWeights) throws MathIllegalArgumentException
pointsAndWeights
- Integration points and corresponding weights.MathIllegalArgumentException
- if the points
are not
sorted in increasing order.SymmetricGaussIntegrator(double[], double[])
public double integrate(UnivariateFunction f)
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
.integrate
in class GaussIntegrator
f
- Function to integrate.Copyright © 2016–2018 Hipparchus.org. All rights reserved.