Package org.tensorics.core.reduction
Class AbstractInterpolationStrategy<C,V>
- java.lang.Object
-
- org.tensorics.core.reduction.AbstractInterpolationStrategy<C,V>
-
- Type Parameters:
C
- type of the coordinate, must beComparable
V
- type of the value in theTensor
- All Implemented Interfaces:
InterpolationStrategy<C,V>
- Direct Known Subclasses:
AbstractLinearDoubleInterpolationStrategy
,LinearInterpolation
public abstract class AbstractInterpolationStrategy<C,V> extends java.lang.Object implements InterpolationStrategy<C,V>
An abstract interpolation implementation that provides the basic functions like sorting theComparable
coordinate and finding the PREVIOUS/NEXT instances in the coordinates.
-
-
Constructor Summary
Constructors Constructor Description AbstractInterpolationStrategy(java.util.Comparator<C> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected C
findIndex(java.util.List<C> orderedList, C referencePosition, int indexMove)
Finds the comparable coordinate before of after the slice position.protected java.util.List<C>
getOrderedListOfComparableCoordinate(Tensor<V> tensorWithTheOnlyOneCoordinateOfC, C coordinateToInterpolate)
Extracts the ordered list of the comparable coordinate along which the interpolation will be done-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tensorics.core.reduction.InterpolationStrategy
getInterpolatedValue
-
-
-
-
Constructor Detail
-
AbstractInterpolationStrategy
public AbstractInterpolationStrategy(java.util.Comparator<C> comparator)
-
-
Method Detail
-
getOrderedListOfComparableCoordinate
protected java.util.List<C> getOrderedListOfComparableCoordinate(Tensor<V> tensorWithTheOnlyOneCoordinateOfC, C coordinateToInterpolate)
Extracts the ordered list of the comparable coordinate along which the interpolation will be done- Parameters:
tensorWithTheOnlyOneCoordinateOfC
- tensor with only ONE coordinatecoordinateToInterpolate
- the coordinate to extract- Returns:
- an ordered (ascending) list of the comparable coordinates
-
findIndex
protected C findIndex(java.util.List<C> orderedList, C referencePosition, int indexMove)
Finds the comparable coordinate before of after the slice position.- Parameters:
orderedList
- an ordered list of coordinatesreferencePosition
-indexMove
- if 0 then the PREVIOUS will be returned, if +1 the NEXT will be returned.- Returns:
- the comparable coordinate BEFORE or AFTER the reference one.
-
-