SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.integration.univariate.riemann
Interface IterativeIntegrator

All Superinterfaces:
Integrator
All Known Implementing Classes:
EulerMaclaurin, Midpoint, 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.

To prevent infinite looping, we need to bound the number of iterations.


Method Summary
 double h()
          Get the discretization size for the current iteration.
 int maxIterations()
          Get the maximum number of iterations for this iterative procedure.
 double next(int iteration, UnivariateRealFunction f, double a, double b, double sum)
          Compute a refined sum for the integral.
 
Methods inherited from interface com.numericalmethod.suanshu.analysis.integration.univariate.riemann.Integrator
integrate, precision
 

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 sum)
Compute a refined sum for the integral.

Parameters:
iteration - the index/count for the iterations; it counts from 1
f - the integrand
a - the lower limit
b - the upper limit
sum - the last sum
Returns:
a refined sum

maxIterations

int maxIterations()
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

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.