org.spaceroots.mantissa.quadrature.scalar
Class TrapezoidIntegratorSampler

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

public class TrapezoidIntegratorSampler
extends Object
implements SampledFunctionIterator

This class implements a trapezoid integrator as a sample.

A trapezoid 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.

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

Constructor Summary
TrapezoidIntegratorSampler(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

TrapezoidIntegratorSampler

public TrapezoidIntegratorSampler(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.