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 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 1
        f - the integrand
        a - the lower limit
        b - the upper limit
        sum0 - 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