org.spaceroots.mantissa.quadrature.vectorial
Class TrapezoidIntegratorSampler

java.lang.Object
  extended byorg.spaceroots.mantissa.quadrature.vectorial.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 1709 2006-12-03 21:16:50Z luc $
Author:
L. Maisonobe
See Also:
TrapezoidIntegrator

Constructor Summary
TrapezoidIntegratorSampler(SampledFunctionIterator iter)
          Constructor.
 
Method Summary
 int getDimension()
          Get the dimension of the vectorial values of the function.
 boolean hasNext()
          Check if the iterator can provide another point.
 VectorialValuedPair 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.

getDimension

public int getDimension()
Description copied from interface: SampledFunctionIterator
Get the dimension of the vectorial values of the function.

Specified by:
getDimension in interface SampledFunctionIterator
Returns:
dimension

nextSamplePoint

public VectorialValuedPair 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:
ExhaustedSampleException - if the sample has been exhausted
FunctionException - if the underlying function throws one


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