org.spaceroots.mantissa.quadrature.scalar
Class RiemannIntegratorSampler

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

public class RiemannIntegratorSampler
extends Object
implements SampledFunctionIterator

This class implements a Riemann integrator as a sample.

A Riemann 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: RiemannIntegratorSampler.java 1237 2002-03-20 21:01:57Z luc $
Author:
L. Maisonobe
See Also:
RiemannIntegrator

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

RiemannIntegratorSampler

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