public class GaussIntegrator extends Object
integrating
a weighted
function.Constructor and Description |
---|
GaussIntegrator(double[] pointsIn,
double[] weightsIn)
Creates an integrator from the given
points and weights . |
GaussIntegrator(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 and Description |
---|---|
int |
getNumberOfPoints() |
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. |
public GaussIntegrator(double[] pointsIn, double[] weightsIn)
points
and weights
.
The integration interval is defined by the first and last value of points
which must be sorted in
increasing order.pointsIn
- Integration points.weightsIn
- Weights of the corresponding integration nodes.NonMonotonicSequenceException
- if the points
are not
sorted in increasing order.public GaussIntegrator(Pair<double[],double[]> pointsAndWeights)
pointsAndWeights
- Integration points and corresponding weights.NonMonotonicSequenceException
- if the points
are not
sorted in increasing order.GaussIntegrator(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
.f
- Function to integrate.public int getNumberOfPoints()
Copyright © 2019 CNES. All rights reserved.