org.apache.commons.math3.analysis.integration
Class BaseAbstractUnivariateIntegrator
- java.lang.Object
-
- org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator
-
- All Implemented Interfaces:
- UnivariateIntegrator
- Direct Known Subclasses:
- IterativeLegendreGaussIntegrator, LegendreGaussIntegrator, MidPointIntegrator, RombergIntegrator, SimpsonIntegrator, TrapezoidIntegrator
public abstract class BaseAbstractUnivariateIntegrator extends java.lang.Object implements UnivariateIntegrator
Provide a default implementation for several generic functions.- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleDEFAULT_ABSOLUTE_ACCURACYDefault absolute accuracy.static intDEFAULT_MAX_ITERATIONS_COUNTDefault maximal iteration count.static intDEFAULT_MIN_ITERATIONS_COUNTDefault minimal iteration count.static doubleDEFAULT_RELATIVE_ACCURACYDefault relative accuracy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetAbsoluteAccuracy()Get the absolute accuracy.intgetEvaluations()Get the number of function evaluations of the last run of the integrator.intgetIterations()Get the number of iterations of the last run of the integrator.intgetMaximalIterationCount()Get the upper limit for the number of iterations.intgetMinimalIterationCount()Get the min limit for the number of iterations.doublegetRelativeAccuracy()Get the relative accuracy.doubleintegrate(int maxEval, UnivariateFunction f, double lower, double upper)Integrate the function in the given interval.
-
-
-
Field Detail
-
DEFAULT_ABSOLUTE_ACCURACY
public static final double DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy.- See Also:
- Constant Field Values
-
DEFAULT_RELATIVE_ACCURACY
public static final double DEFAULT_RELATIVE_ACCURACY
Default relative accuracy.- See Also:
- Constant Field Values
-
DEFAULT_MIN_ITERATIONS_COUNT
public static final int DEFAULT_MIN_ITERATIONS_COUNT
Default minimal iteration count.- See Also:
- Constant Field Values
-
DEFAULT_MAX_ITERATIONS_COUNT
public static final int DEFAULT_MAX_ITERATIONS_COUNT
Default maximal iteration count.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRelativeAccuracy
public double getRelativeAccuracy()
Get the relative accuracy.- Specified by:
getRelativeAccuracyin interfaceUnivariateIntegrator- Returns:
- the accuracy
-
getAbsoluteAccuracy
public double getAbsoluteAccuracy()
Get the absolute accuracy.- Specified by:
getAbsoluteAccuracyin interfaceUnivariateIntegrator- Returns:
- the accuracy
-
getMinimalIterationCount
public int getMinimalIterationCount()
Get the min limit for the number of iterations.- Specified by:
getMinimalIterationCountin interfaceUnivariateIntegrator- Returns:
- the actual min limit
-
getMaximalIterationCount
public int getMaximalIterationCount()
Get the upper limit for the number of iterations.- Specified by:
getMaximalIterationCountin interfaceUnivariateIntegrator- Returns:
- the actual upper limit
-
getEvaluations
public int getEvaluations()
Get the number of function evaluations of the last run of the integrator.- Specified by:
getEvaluationsin interfaceUnivariateIntegrator- Returns:
- number of function evaluations
-
getIterations
public int getIterations()
Get the number of iterations of the last run of the integrator.- Specified by:
getIterationsin interfaceUnivariateIntegrator- Returns:
- number of iterations
-
integrate
public double integrate(int maxEval, UnivariateFunction f, double lower, double upper) throws TooManyEvaluationsException, MaxCountExceededException, MathIllegalArgumentException, NullArgumentExceptionIntegrate the function in the given interval.- Specified by:
integratein interfaceUnivariateIntegrator- Parameters:
maxEval- Maximum number of evaluations.f- the integrand functionlower- the lower bound for the intervalupper- the upper bound for the interval- Returns:
- the value of integral
- Throws:
TooManyEvaluationsException- if the maximum number of function evaluations is exceededMaxCountExceededException- if the maximum iteration count is exceeded or the integrator detects convergence problems otherwiseMathIllegalArgumentException- ifmin > maxor the endpoints do not satisfy the requirements specified by the integratorNullArgumentException- iffisnull.
-
-
DMelt 3.0 © DataMelt by jWork.ORG