|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator
org.apache.commons.math3.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 function evaluations. A Legendre-Gauss integrator using an n-points quadrature formula can integrate 2n-1 degree polynomials exactly.
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.
Field Summary | |
---|---|
private double[] |
abscissas
Abscissas for the current method. |
private static double[] |
ABSCISSAS_2
Abscissas for the 2 points method. |
private static double[] |
ABSCISSAS_3
Abscissas for the 3 points method. |
private static double[] |
ABSCISSAS_4
Abscissas for the 4 points method. |
private static double[] |
ABSCISSAS_5
Abscissas for the 5 points method. |
private double[] |
weights
Weights for the current method. |
private static double[] |
WEIGHTS_2
Weights for the 2 points method. |
private static double[] |
WEIGHTS_3
Weights for the 3 points method. |
private static double[] |
WEIGHTS_4
Weights for the 4 points method. |
private static double[] |
WEIGHTS_5
Weights for the 5 points method. |
Fields inherited from class org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator |
---|
DEFAULT_ABSOLUTE_ACCURACY, DEFAULT_MAX_ITERATIONS_COUNT, DEFAULT_MIN_ITERATIONS_COUNT, DEFAULT_RELATIVE_ACCURACY, iterations |
Constructor Summary | |
---|---|
LegendreGaussIntegrator(int n,
double relativeAccuracy,
double absoluteAccuracy)
Build a Legendre-Gauss integrator with given accuracies. |
|
LegendreGaussIntegrator(int n,
double relativeAccuracy,
double absoluteAccuracy,
int minimalIterationCount,
int maximalIterationCount)
Build a Legendre-Gauss integrator with given accuracies and iterations counts. |
|
LegendreGaussIntegrator(int n,
int minimalIterationCount,
int maximalIterationCount)
Build a Legendre-Gauss integrator with given iteration counts. |
Method Summary | |
---|---|
protected double |
doIntegrate()
Method for implementing actual integration algorithms in derived classes. |
private double |
stage(int n)
Compute the n-th stage integral. |
Methods inherited from class org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator |
---|
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getIterations, getMax, getMaximalIterationCount, getMin, getMinimalIterationCount, getRelativeAccuracy, integrate, setup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final double[] ABSCISSAS_2
private static final double[] WEIGHTS_2
private static final double[] ABSCISSAS_3
private static final double[] WEIGHTS_3
private static final double[] ABSCISSAS_4
private static final double[] WEIGHTS_4
private static final double[] ABSCISSAS_5
private static final double[] WEIGHTS_5
private final double[] abscissas
private final double[] weights
Constructor Detail |
---|
public LegendreGaussIntegrator(int n, double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount) throws NotStrictlyPositiveException, NumberIsTooSmallException
n
- number of points desired (must be between 2 and 5 inclusive)relativeAccuracy
- relative accuracy of the resultabsoluteAccuracy
- absolute accuracy of the resultminimalIterationCount
- minimum number of iterationsmaximalIterationCount
- maximum number of iterations
NotStrictlyPositiveException
- if minimal number of iterations
is not strictly positive
NumberIsTooSmallException
- if maximal number of iterations
is lesser than or equal to the minimal number of iterationspublic LegendreGaussIntegrator(int n, double relativeAccuracy, double absoluteAccuracy)
n
- number of points desired (must be between 2 and 5 inclusive)relativeAccuracy
- relative accuracy of the resultabsoluteAccuracy
- absolute accuracy of the resultpublic LegendreGaussIntegrator(int n, int minimalIterationCount, int maximalIterationCount)
n
- number of points desired (must be between 2 and 5 inclusive)minimalIterationCount
- minimum number of iterationsmaximalIterationCount
- maximum number of iterations
NotStrictlyPositiveException
- if minimal number of iterations
is not strictly positive
NumberIsTooSmallException
- if maximal number of iterations
is lesser than or equal to the minimal number of iterationsMethod Detail |
---|
protected double doIntegrate() throws TooManyEvaluationsException, MaxCountExceededException
doIntegrate
in class BaseAbstractUnivariateIntegrator
TooManyEvaluationsException
- if the maximal number of evaluations
is exceeded.
MaxCountExceededException
- if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwiseprivate double stage(int n) throws TooManyEvaluationsException
n
- number of steps
TooManyEvaluationsException
- if the maximum number of evaluations
is exceeded.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |