org.jscience.mathematics.analysis.quadrature
Class EnhancedSimpsonNDIntegrator

java.lang.Object
  extended by org.jscience.mathematics.analysis.quadrature.EnhancedSimpsonNDIntegrator
All Implemented Interfaces:
SampledMappingNDIntegrator

public class EnhancedSimpsonNDIntegrator
extends java.lang.Object
implements SampledMappingNDIntegrator

This class implements an enhanced Simpson-like integrator.

A traditional Simpson integrator is based on a quadratic approximation of the function on three equally spaced points. This integrator does the same thing but can handle non-equally spaced points. If it is used on a regular sample, it behaves exactly as a traditional Simpson integrator.


Constructor Summary
EnhancedSimpsonNDIntegrator()
           
 
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

EnhancedSimpsonNDIntegrator

public EnhancedSimpsonNDIntegrator()
Method Detail

integrate

public double[] integrate(SampledMappingIterator iter)
                   throws ExhaustedSampleException,
                          MappingException
Description copied from interface: SampledMappingNDIntegrator
Integrate a sample over its overall range

Specified by:
integrate in interface SampledMappingNDIntegrator
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