org.spaceroots.mantissa.quadrature.scalar
Class EnhancedSimpsonIntegratorSampler
- java.lang.Object
-
- org.spaceroots.mantissa.quadrature.scalar.EnhancedSimpsonIntegratorSampler
-
- All Implemented Interfaces:
- SampledFunctionIterator
public class EnhancedSimpsonIntegratorSampler extends java.lang.Object implements SampledFunctionIterator
This class implements an enhanced Simpson integrator as a sample.A traditional Simpson integrator is based on a quadratic approximation of the function on three equally spaced points. This integrator does the same thing but can handle non-equally spaced points. If it is used on a regular sample, it behaves exactly as a traditional Simpson integrator.
- See Also:
EnhancedSimpsonIntegrator
-
-
Constructor Summary
Constructors Constructor and Description EnhancedSimpsonIntegratorSampler(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
-
EnhancedSimpsonIntegratorSampler
public EnhancedSimpsonIntegratorSampler(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