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

• java.lang.Object
• ### Constructor Summary

Constructors
Constructor and Description
GaussianQuadratureAbstractTest(GaussIntegrator integrator, int maxDegree, double eps, double numUlps)
Creates a new instance of this abstract test with the specified quadrature rule.
• ### Method Summary

Methods
Modifier and Type Method and Description
abstract double getExpectedValue(int n)
Returns the expected value of the integral of the specified monomial.
void testAllMonomials()
Checks that the value of the integral of each monomial x0, ... , xp returned by the quadrature rule under test conforms with the expected value.
• ### Constructor Detail

int maxDegree,
double eps,
double numUlps)
Creates a new instance of this abstract test with the specified quadrature rule. If the expected value is non-zero, equality of actual and expected values is checked in the relative sense
|xact - xexp| ≤  n  Math.ulp(xexp),
where n is the maximum relative error (in ulps). If the expected value is zero, the test checks that
|xact| ≤ ε,
where ε is the maximum absolute error.
Parameters:
integrator - Quadrature rule under test.
maxDegree - Maximum degree of monomials to be tested.
eps - ε.
numUlps - Value of the maximum relative error (in ulps).
• ### Method Detail

• #### getExpectedValue

public abstract double getExpectedValue(int n)
Returns the expected value of the integral of the specified monomial. The integration is carried out on the natural interval of the quadrature rule under test.
Parameters:
n - Degree of the monomial.
Returns:
the expected value of the integral of xn.
• #### testAllMonomials

public void testAllMonomials()
Checks that the value of the integral of each monomial x0, ... , xp returned by the quadrature rule under test conforms with the expected value. Here p denotes the degree of the highest polynomial for which exactness is to be expected.