Interface UnivariateRealIntegrator
-
- All Superinterfaces:
ConvergingAlgorithm
- All Known Implementing Classes:
LegendreGaussIntegrator
,RombergIntegrator
,SimpsonIntegrator
,TrapezoidIntegrator
,UnivariateRealIntegratorImpl
public interface UnivariateRealIntegrator extends ConvergingAlgorithm
Interface for univariate real integration algorithms.- Since:
- 1.2
- Version:
- $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getMinimalIterationCount()
Get the lower limit for the number of iterations.double
getResult()
Get the result of the last run of the integrator.double
integrate(double min, double max)
Deprecated.replaced byintegrate(UnivariateRealFunction, double, double)
since 2.0double
integrate(UnivariateRealFunction f, double min, double max)
Integrate the function in the given interval.void
resetMinimalIterationCount()
Reset the lower limit for the number of iterations to the default.void
setMinimalIterationCount(int count)
Set the lower limit for the number of iterations.-
Methods inherited from interface org.apache.commons.math.ConvergingAlgorithm
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
-
-
-
-
Method Detail
-
setMinimalIterationCount
void setMinimalIterationCount(int count)
Set the lower limit for the number of iterations.Minimal iteration is needed to avoid false early convergence, e.g. the sample points happen to be zeroes of the function. Users can use the default value or choose one that they see as appropriate.
A
ConvergenceException
will be thrown if this number is not met.- Parameters:
count
- minimum number of iterations
-
getMinimalIterationCount
int getMinimalIterationCount()
Get the lower limit for the number of iterations.- Returns:
- the actual lower limit
-
resetMinimalIterationCount
void resetMinimalIterationCount()
Reset the lower limit for the number of iterations to the default.The default value is supplied by the implementation.
- See Also:
setMinimalIterationCount(int)
-
integrate
@Deprecated double integrate(double min, double max) throws ConvergenceException, FunctionEvaluationException, java.lang.IllegalArgumentException
Deprecated.replaced byintegrate(UnivariateRealFunction, double, double)
since 2.0Integrate the function in the given interval.- Parameters:
min
- the lower bound for the intervalmax
- the upper bound for the interval- Returns:
- the value of integral
- Throws:
ConvergenceException
- if the maximum iteration count is exceeded or the integrator detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if min > max or the endpoints do not satisfy the requirements specified by the integrator
-
integrate
double integrate(UnivariateRealFunction f, double min, double max) throws ConvergenceException, FunctionEvaluationException, java.lang.IllegalArgumentException
Integrate the function in the given interval.- Parameters:
f
- the integrand functionmin
- the lower bound for the intervalmax
- the upper bound for the interval- Returns:
- the value of integral
- Throws:
ConvergenceException
- if the maximum iteration count is exceeded or the integrator detects convergence problems otherwiseFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if min > max or the endpoints do not satisfy the requirements specified by the integrator
-
getResult
double getResult() throws java.lang.IllegalStateException
Get the result of the last run of the integrator.- Returns:
- the last result
- Throws:
java.lang.IllegalStateException
- if there is no result available, either because no result was yet computed or the last attempt failed
-
-