class PartlyFixedMultiIndexLinearizer 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.Sequencer
OPEN
Constructor and Description |
---|
PartlyFixedMultiIndexLinearizer(MultiIndexLinearizer basicLinearizer,
int... fixedIndexes)
Create a lower-dimensional linearizer by providing some fixed indexes.
|
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, wait
checkIndex, checkIndexes, getHighFastSequencer, getLowFastSequencer, sub
PartlyFixedMultiIndexLinearizer(@NotNull MultiIndexLinearizer basicLinearizer, @NotNull int... fixedIndexes)
basicLinearizer
- basic linearizer with n dimensionsfixedIndexes
- indexes of sub array,
negative for open indexes which can still be evalutated
by the returned linearizer,
or 0
or positive for fixed indexes. If
there are not enough indexes the missing ones
are considered open.public int getNumDimensions()
MultiDimensional
getNumDimensions
in interface MultiDimensional
public int getSize(int dim)
MultiDimensional
getSize
in interface MultiDimensional
dim
- dimension, greater than 0
and less than MultiDimensional.getNumDimensions()
@NotNull public int[] getSizes()
MultiDimensional
getSizes
in interface MultiDimensional
MultiDimensional.getNumDimensions()
public int toLinear(@NotNull int... indexes)
MultiIndexLinearizer
MultiDimensional.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 MultiIndexLinearizer
indexes
- MultiDimensional.getNumDimensions()
indexes inside the ranges defined
by MultiDimensional.getSizes()
public long getNumElements()
MultiDimensional
getNumElements
in interface MultiDimensional