SuanShu, a Java numerical and statistical library

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

All Known Subinterfaces:
IterativeIntegrator
All Known Implementing Classes:
ChangeOfVariable, EulerMaclaurin, Midpoint, Riemann, Romberg, Simpson, Trapezoidal

public interface Integrator

This is the interface for numerical integration of univariate functions. A broad family of algorithms for calculating the numerical value of a definite integral implements this interface.

See Also:
Wikipedia: Numerical integration

Method Summary
 double integrate(UnivariateRealFunction f, double a, double b)
          Integrate function f from a to b.
 double precision()
          Get the convergence threshold.
 

Method Detail

integrate

double integrate(UnivariateRealFunction f,
                 double a,
                 double b)
Integrate function f from a to b.
 / b
 |   f(x) dx
 / a
 

Parameters:
f - a univariate function
a - lower limit
b - upper limit
Returns:
Σ(f(x))

precision

double precision()
Get the convergence threshold. The usage depends on the specific integrator.

For example, for an IterativeIntegrator, the integral is considered converged if the relative error of two successive sums is less than the threshold.

Returns:
the precision

SuanShu, a Java numerical and statistical library

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