org.jscience.mathematics.analysis.quadrature
Class TrapezoidIntegrator

java.lang.Object
  extended by org.jscience.mathematics.analysis.quadrature.TrapezoidIntegrator
All Implemented Interfaces:
SampledMappingIntegrator

public class TrapezoidIntegrator
extends java.lang.Object
implements SampledMappingIntegrator

This class implements a trapezoid integrator.

A trapezoid integrator is a very simple one that assumes the function is linear over the integration step.


Constructor Summary
TrapezoidIntegrator()
           
 
Method Summary
 double integrate(SampledMappingIterator iter)
          Integrate a sample over its overall range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrapezoidIntegrator

public TrapezoidIntegrator()
Method Detail

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