org.spaceroots.mantissa.functions.vectorial
Class BasicSampledFunctionIterator
- java.lang.Object
-
- org.spaceroots.mantissa.functions.vectorial.BasicSampledFunctionIterator
-
- All Implemented Interfaces:
- java.io.Serializable, SampledFunctionIterator
public class BasicSampledFunctionIterator extends java.lang.Object implements SampledFunctionIterator, java.io.Serializable
This class is a wrapper allowing to iterate over a SampledFunction.The basic implementation of the iteration interface does not perform any transformation on the sample, it only handles a loop over the underlying sampled function.
- See Also:
SampledFunction, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BasicSampledFunctionIterator(SampledFunction function)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetDimension()Get the dimension of the vectorial values of the function.booleanhasNext()Check if the iterator can provide another point.VectorialValuedPairnextSamplePoint()Get the next point of a sampled function.
-
-
-
Constructor Detail
-
BasicSampledFunctionIterator
public BasicSampledFunctionIterator(SampledFunction function)
Simple constructor. Build an instance from a SampledFunction- Parameters:
function- smapled function over which we want to iterate
-
-
Method Detail
-
getDimension
public int getDimension()
Description copied from interface:SampledFunctionIteratorGet the dimension of the vectorial values of the function.- Specified by:
getDimensionin interfaceSampledFunctionIterator- Returns:
- dimension
-
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 VectorialValuedPair 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