|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.ConvergingAlgorithmImpl
org.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl
org.apache.commons.math.analysis.integration.LegendreGaussIntegrator
public class LegendreGaussIntegrator
Implements the Legendre-Gauss quadrature formula.
Legendre-Gauss integrators are efficient integrators that can accurately integrate functions with few functions evaluations. A Legendre-Gauss integrator using an n-points quadrature formula can integrate exactly 2n-1 degree polynomials.
These integrators evaluate the function on n carefully chosen abscissas in each step interval (mapped to the canonical [-1 1] interval). The evaluation abscissas are not evenly spaced and none of them are at the interval endpoints. This implies the function integrated can be undefined at integration interval endpoints.
The evaluation abscissas xi are the roots of the degree n Legendre polynomial. The weights ai of the quadrature formula integrals from -1 to +1 ∫ Li2 where Li (x) = ∏ (x-xk)/(xi-xk) for k != i.
Constructor Summary | |
---|---|
LegendreGaussIntegrator(int n,
int defaultMaximalIterationCount)
Build a Legendre-Gauss integrator. |
Method Summary | |
---|---|
double |
integrate(double min,
double max)
Deprecated. |
double |
integrate(UnivariateRealFunction f,
double min,
double max)
Integrate the function in the given interval. |
Methods inherited from class org.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl |
---|
getMinimalIterationCount, getResult, resetMinimalIterationCount, setMinimalIterationCount |
Methods inherited from class org.apache.commons.math.ConvergingAlgorithmImpl |
---|
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.ConvergingAlgorithm |
---|
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy |
Constructor Detail |
---|
public LegendreGaussIntegrator(int n, int defaultMaximalIterationCount) throws IllegalArgumentException
n
- number of points desired (must be between 2 and 5 inclusive)defaultMaximalIterationCount
- maximum number of iterations
IllegalArgumentException
- if the number of points is not
in the supported rangeMethod Detail |
---|
@Deprecated public double integrate(double min, double max) throws ConvergenceException, FunctionEvaluationException, IllegalArgumentException
min
- the lower bound for the intervalmax
- the upper bound for the interval
ConvergenceException
- if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwise
FunctionEvaluationException
- if an error occurs evaluating the
function
IllegalArgumentException
- if min > max or the endpoints do not
satisfy the requirements specified by the integratorpublic double integrate(UnivariateRealFunction f, double min, double max) throws ConvergenceException, FunctionEvaluationException, IllegalArgumentException
f
- the integrand functionmin
- the lower bound for the intervalmax
- the upper bound for the interval
ConvergenceException
- if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwise
FunctionEvaluationException
- if an error occurs evaluating the function
IllegalArgumentException
- if min > max or the endpoints do not
satisfy the requirements specified by the integrator
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |