public final class SlicerIndexMapper extends java.lang.Object implements IndexMapper
Ths class stores the result shape without dropping the dimensions that are ultimately dropped in order to more efficiently calculate source to result index mappings.
Dimensions are dropped for example given 1:2,3 then the 2nd dimension length will be 1 and ALSO dropped but the first dimension will be kept despite also being length one. This is done this way to mimic numpy behaviour.
| Constructor and Description |
|---|
SlicerIndexMapper(Slicer slicer,
long[] sourceShape,
long[] sourceStride) |
| Modifier and Type | Method and Description |
|---|---|
long[] |
getResultShape() |
long[] |
getResultStride() |
long |
getSourceIndexFromResultIndex(long resultIndex) |
public SlicerIndexMapper(Slicer slicer, long[] sourceShape, long[] sourceStride)
public long[] getResultShape()
getResultShape in interface IndexMapperpublic long[] getResultStride()
getResultStride in interface IndexMapperpublic long getSourceIndexFromResultIndex(long resultIndex)
getSourceIndexFromResultIndex in interface IndexMapperresultIndex - the index in the result buffer