org.apache.commons.math3.analysis.integration.gauss

## Class GaussIntegrator

• java.lang.Object
• org.apache.commons.math3.analysis.integration.gauss.GaussIntegrator
• ### Constructor Summary

Constructors
Constructor and Description
GaussIntegrator(double[] points, double[] weights)
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.
• ### Method Detail

• #### integrate

public 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. The algorithm uses the points and associated weights, as passed to the constructor.
Parameters:
f - Function to integrate.
Returns:
the integral of the weighted function.
• #### getNumberOfPoints

public int getNumberOfPoints()
Returns:
the order of the integration rule (the number of integration points).
• #### getPoint

public double getPoint(int index)
Gets the integration point at the given index. The index must be in the valid range but no check is performed.
Parameters:
index - index of the integration point
Returns:
the integration point.
• #### getWeight

public double getWeight(int index)
Gets the weight of the integration point at the given index. The index must be in the valid range but no check is performed.
Parameters:
index - index of the integration point
Returns:
the weight.