org.spaceroots.mantissa.quadrature.scalar
Class RiemannIntegratorSampler
- java.lang.Object
-
- org.spaceroots.mantissa.quadrature.scalar.RiemannIntegratorSampler
-
- All Implemented Interfaces:
- SampledFunctionIterator
public class RiemannIntegratorSampler extends java.lang.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.
- See Also:
RiemannIntegrator
-
-
Constructor Summary
Constructors Constructor and Description RiemannIntegratorSampler(SampledFunctionIterator iter)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanhasNext()Check if the iterator can provide another point.ScalarValuedPairnextSamplePoint()Get the next point of a sampled function.
-
-
-
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- Throws:
ExhaustedSampleExceptionFunctionException
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:SampledFunctionIteratorCheck if the iterator can provide another point.- Specified by:
hasNextin interfaceSampledFunctionIterator- Returns:
- true if the iterator can provide another point.
-
nextSamplePoint
public ScalarValuedPair nextSamplePoint() throws ExhaustedSampleException, FunctionException
Description copied from interface:SampledFunctionIteratorGet the next point of a sampled function.- Specified by:
nextSamplePointin interfaceSampledFunctionIterator- Returns:
- the next point of the sampled function
- Throws:
ExhaustedSampleException- if the sample has been exhaustedFunctionException- if the underlying function throws one
-
-
DataMelt 3.0 © DataMelt by jWork.ORG