public class LowFastMultiIndexLinearizer extends java.lang.Object implements MultiIndexLinearizer
1. So iterating over these might result in caching effects.MultiIndexLinearizer.BasicSequencer, MultiIndexLinearizer.Sequencer| Modifier and Type | Field and Description |
|---|---|
(package private) int[] |
sizes
The sizes of the dimensions of this array.
|
OPEN| Modifier | Constructor and Description |
|---|---|
protected |
LowFastMultiIndexLinearizer(int... sizes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
fromLinear(int linearIndex)
Get the multi-dimensional index mapped to a given linear index.
|
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, sub@NotNull final int[] sizes
protected LowFastMultiIndexLinearizer(int... sizes)
sizes - of the dimensions of this array,
e.g. (2, 3, 4} will create
an oblong array with size 2 in the first,
size 3 in the second, and size 4 in the third
dimension, containing 2*3*4 = 24 elementspublic 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 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 long getNumElements()
MultiDimensionalgetNumElements in interface MultiDimensional@NotNull public int[] fromLinear(int linearIndex)
linearIndex - linear index between 0 (included) and
getNumElements() (excluded)linearIndex