Class IterativeLegendreFieldGaussIntegrator<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator<T>
-
- org.hipparchus.analysis.integration.IterativeLegendreFieldGaussIntegrator<T>
-
- Type Parameters:
T
- Type of the field elements.
- All Implemented Interfaces:
FieldUnivariateIntegrator<T>
public class IterativeLegendreFieldGaussIntegrator<T extends CalculusFieldElement<T>> extends BaseAbstractFieldUnivariateIntegrator<T>
This algorithm divides the integration interval into equally-sized sub-interval and on each of them performs a Legendre-Gauss quadrature. Because of its non-adaptive nature, this algorithm can converge to a wrong value for the integral (for example, if the function is significantly different from zero toward the ends of the integration interval). In particular, a change of variables aimed at estimating integrals over infinite intervals as proposed here should be avoided when using this class.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator
DEFAULT_ABSOLUTE_ACCURACY, DEFAULT_MAX_ITERATIONS_COUNT, DEFAULT_MIN_ITERATIONS_COUNT, DEFAULT_RELATIVE_ACCURACY, iterations
-
-
Constructor Summary
Constructors Constructor Description IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, double relativeAccuracy, double absoluteAccuracy)
Builds an integrator with given accuracies.IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount)
Builds an integrator with given accuracies and iterations counts.IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, int minimalIterationCount, int maximalIterationCount)
Builds an integrator with given iteration counts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected T
doIntegrate()
Method for implementing actual integration algorithms in derived classes.-
Methods inherited from class org.hipparchus.analysis.integration.BaseAbstractFieldUnivariateIntegrator
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getField, getIterations, getMax, getMaximalIterationCount, getMin, getMinimalIterationCount, getRelativeAccuracy, integrate, setup
-
-
-
-
Constructor Detail
-
IterativeLegendreFieldGaussIntegrator
public IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException
Builds an integrator with given accuracies and iterations counts.- Parameters:
field
- field to which function argument and value belongn
- Number of integration points.relativeAccuracy
- Relative accuracy of the result.absoluteAccuracy
- Absolute accuracy of the result.minimalIterationCount
- Minimum number of iterations.maximalIterationCount
- Maximum number of iterations.- Throws:
MathIllegalArgumentException
- if minimal number of iterations or number of points are not strictly positive.MathIllegalArgumentException
- if maximal number of iterations is smaller than or equal to the minimal number of iterations.
-
IterativeLegendreFieldGaussIntegrator
public IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, double relativeAccuracy, double absoluteAccuracy) throws MathIllegalArgumentException
Builds an integrator with given accuracies.- Parameters:
field
- field to which function argument and value belongn
- Number of integration points.relativeAccuracy
- Relative accuracy of the result.absoluteAccuracy
- Absolute accuracy of the result.- Throws:
MathIllegalArgumentException
- ifn < 1
.
-
IterativeLegendreFieldGaussIntegrator
public IterativeLegendreFieldGaussIntegrator(Field<T> field, int n, int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException
Builds an integrator with given iteration counts.- Parameters:
field
- field to which function argument and value belongn
- Number of integration points.minimalIterationCount
- Minimum number of iterations.maximalIterationCount
- Maximum number of iterations.- Throws:
MathIllegalArgumentException
- if minimal number of iterations is not strictly positive.MathIllegalArgumentException
- if maximal number of iterations is smaller than or equal to the minimal number of iterations.MathIllegalArgumentException
- ifn < 1
.
-
-
Method Detail
-
doIntegrate
protected T doIntegrate() throws MathIllegalArgumentException, MathIllegalStateException
Method for implementing actual integration algorithms in derived classes.- Specified by:
doIntegrate
in classBaseAbstractFieldUnivariateIntegrator<T extends CalculusFieldElement<T>>
- Returns:
- the root.
- Throws:
MathIllegalStateException
- if the maximal number of evaluations is exceeded.MathIllegalArgumentException
-
-