org.spaceroots.mantissa.quadrature.scalar
Class EnhancedSimpsonIntegratorSampler

java.lang.Object
  extended byorg.spaceroots.mantissa.quadrature.scalar.EnhancedSimpsonIntegratorSampler
All Implemented Interfaces:
SampledFunctionIterator

public class EnhancedSimpsonIntegratorSampler
extends Object
implements SampledFunctionIterator

This class implements an enhanced Simpson integrator as a sample.

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.

Version:
$Id: EnhancedSimpsonIntegratorSampler.java 1237 2002-03-20 21:01:57Z luc $
Author:
L. Maisonobe
See Also:
EnhancedSimpsonIntegrator

Constructor Summary
EnhancedSimpsonIntegratorSampler(SampledFunctionIterator iter)
          Constructor.
 
Method Summary
 boolean hasNext()
          Check if the iterator can provide another point.
 ScalarValuedPair nextSamplePoint()
          Get the next point of a sampled function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancedSimpsonIntegratorSampler

public EnhancedSimpsonIntegratorSampler(SampledFunctionIterator iter)
                                 throws ExhaustedSampleException,
                                        FunctionException
Constructor. Build an integrator from an underlying sample iterator.

Parameters:
iter - iterator over the base function
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: SampledFunctionIterator
Check if the iterator can provide another point.

Specified by:
hasNext in interface SampledFunctionIterator
Returns:
true if the iterator can provide another point.

nextSamplePoint

public ScalarValuedPair nextSamplePoint()
                                 throws ExhaustedSampleException,
                                        FunctionException
Description copied from interface: SampledFunctionIterator
Get the next point of a sampled function.

Specified by:
nextSamplePoint in interface SampledFunctionIterator
Returns:
the next point of the sampled function
Throws:
FunctionException - if the underlying function throws one
ExhaustedSampleException - if the sample has been exhausted


Copyright © 2001-2007 Luc Maisonobe. All Rights Reserved.