org.jscience.mathematics.analysis.quadrature
Class RiemannIntegrator
java.lang.Object
org.jscience.mathematics.analysis.quadrature.RiemannIntegrator
- All Implemented Interfaces:
- SampledMappingIntegrator
public class RiemannIntegrator
- extends java.lang.Object
- implements SampledMappingIntegrator
This class implements a Riemann integrator.
A Riemann integrator is a very simple one that assumes the
function is constant over the integration step. Since it is very
simple, this algorithm needs very small steps to achieve high
accuracy, and small steps lead to numerical errors and
instabilities.
This algorithm is almost never used and has been included in
this package only as a simple template for more useful
integrators.
- See Also:
TrapezoidIntegrator
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RiemannIntegrator
public RiemannIntegrator()
integrate
public double integrate(SampledMappingIterator iter)
throws ExhaustedSampleException,
MappingException
- Description copied from interface:
SampledMappingIntegrator
- Integrate a sample over its overall range
- Specified by:
integrate in interface SampledMappingIntegrator
- Parameters:
iter - iterator over the sample to integrate
- Returns:
- value of the integral over the sample range
- Throws:
ExhaustedSampleException - if the sample does not have enough
points for the integration scheme
MappingException - if the underlying sampled function throws one