org.jscience.mathematics.analysis.quadrature
Class RiemannNDIntegratorSampler

java.lang.Object
  extended by org.jscience.mathematics.analysis.quadrature.RiemannNDIntegratorSampler
All Implemented Interfaces:
SampledMappingIterator

public class RiemannNDIntegratorSampler
extends java.lang.Object
implements SampledMappingIterator

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.

See Also:
RiemannIntegrator

Constructor Summary
RiemannNDIntegratorSampler(SampledMappingIterator iter)
          Constructor.
 
Method Summary
 int getDimension()
           
 SampledMapping getSampledMapping()
          DOCUMENT ME!
 boolean hasNext()
          Check if the iterator can provide another point.
 ValuedPair next()
          Get the next point of a sampled function.
 void remove()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RiemannNDIntegratorSampler

public RiemannNDIntegratorSampler(SampledMappingIterator iter)
                           throws ExhaustedSampleException,
                                  MappingException
Constructor. Build an integrator from an underlying sample iterator.

Parameters:
iter - iterator over the base function
Throws:
ExhaustedSampleException
MappingException
Method Detail

getSampledMapping

public SampledMapping getSampledMapping()
Description copied from interface: SampledMappingIterator
DOCUMENT ME!

Specified by:
getSampledMapping in interface SampledMappingIterator
Returns:
DOCUMENT ME!

hasNext

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

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

getDimension

public int getDimension()

next

public ValuedPair next()
                throws ExhaustedSampleException,
                       MappingException
Description copied from interface: SampledMappingIterator
Get the next point of a sampled function.

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

remove

public void remove()
Description copied from interface: SampledMappingIterator
DOCUMENT ME!

Specified by:
remove in interface SampledMappingIterator