class MappingMultiIndexLinearizer extends java.lang.Object implements MultiIndexLinearizer
Not public because automatically created when accessing sub arrays and therefore not fit for base arrays.
MultiIndexLinearizer.BasicSequencer, MultiIndexLinearizer.SequencerOPEN| Constructor and Description |
|---|
MappingMultiIndexLinearizer(MultiIndexLinearizer baseIndexLinearizer,
Function1<int[],int[]> mapper,
int... sizes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumDimensions()
Get the number of dimensions used by this access,
|
long |
getNumElements()
Get the combined number of elements in all dimensions.
|
int |
getSize(int dim)
Get the size of the given dimension.
|
int[] |
getSizes()
Get the sizes of the dimensions of this access.
|
int |
toLinear(int... indexes)
Get the linear index which represents the given multi-dimensional index.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckIndex, checkIndexes, getHighFastSequencer, getLowFastSequencer, subMappingMultiIndexLinearizer(@NotNull MultiIndexLinearizer baseIndexLinearizer, @NotNull Function1<int[],int[]> mapper, int... sizes)
baseIndexLinearizer - basic multi-index linearizer on which this linearizer mapsmapper - mapper from incoming indexes to indexes the baseIndexLinearizer
requires. Failing to fulfill the restrictions will result in
runtime errorssizes - sizes of the dimensions this multi-index linea providespublic int toLinear(int... indexes)
MultiIndexLinearizerMultiDimensional.getNumElements() when this linearizer only
represents a part of a larger-dimensional multi-index.
Good practice is to check the incoming index whether they fulfill
their bounds. Use MultiIndexLinearizer.checkIndexes(int[], int...) for this.
toLinear in interface MultiIndexLinearizerindexes - MultiDimensional.getNumDimensions() indexes inside the ranges defined
by MultiDimensional.getSizes()public int getNumDimensions()
MultiDimensionalgetNumDimensions in interface MultiDimensionalpublic int getSize(int dim)
MultiDimensionalgetSize in interface MultiDimensionaldim - dimension, greater than 0 and less than MultiDimensional.getNumDimensions()@NotNull public int[] getSizes()
MultiDimensionalgetSizes in interface MultiDimensionalMultiDimensional.getNumDimensions()public long getNumElements()
MultiDimensionalgetNumElements in interface MultiDimensional