Interface IterativeIntegrator
-
- All Superinterfaces:
Integrator
- All Known Implementing Classes:
Midpoint
,NewtonCotes
,Simpson
,Trapezoidal
public interface IterativeIntegrator extends Integrator
An iterative integrator computes an integral by a series of sums, which approximates the value of the integral. The sum is refined iteratively, generally, by using a finer discretization of the integrand.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getMaxIterations()
Get the maximum number of iterations for this iterative procedure.double
h()
Get the discretization size for the current iteration.double
next(int iteration, UnivariateRealFunction f, double a, double b, double sum0)
Compute a refined sum for the integral.-
Methods inherited from interface dev.nm.analysis.integration.univariate.riemann.Integrator
getPrecision, integrate
-
-
-
-
Method Detail
-
h
double h()
Get the discretization size for the current iteration.- Returns:
- the discretization size
-
next
double next(int iteration, UnivariateRealFunction f, double a, double b, double sum0)
Compute a refined sum for the integral.- Parameters:
iteration
- the index/count for the current iteration, counting from 1f
- the integranda
- the lower limitb
- the upper limitsum0
- the last sum- Returns:
- a refined sum
-
getMaxIterations
int getMaxIterations()
Get the maximum number of iterations for this iterative procedure. For those integrals that do not converge, we need to put a bound on the number of iterations to avoid infinite looping.- Returns:
- the maximum number of iterations
-
-