public class Simple1DConfiguration extends D1C
NDConfiguration.IndexToIndexFunction, NDConfiguration.Layout, NDConfiguration.Utility
Modifier and Type | Field and Description |
---|---|
protected int |
_shape
The shape of the NDArray.
|
Modifier | Constructor and Description |
---|---|
protected |
Simple1DConfiguration(int shape,
int strides) |
Modifier and Type | Method and Description |
---|---|
static Simple1DConfiguration |
construct(int[] shape,
int[] strides) |
int |
indexOfIndex(int index)
Use this to calculate the true index for an element in the data array (data array index)
based on a provided "virtual index", or "value array index".
|
int |
indexOfIndices(int d1) |
int |
indexOfIndices(int[] indices)
The following method calculates the true index for an element in the data array
based on a provided index array.
|
int[] |
indicesMap()
If one wants to for example access the fourth last item of all items
within a tensor based on a scalar index x then the
NDConfiguration.indicesMap()
is needed as a basis for translating said scalar index x to an array of indices
for every axis of the tensor represented by this NDConfiguration . |
int |
indicesMap(int i)
This method receives an axis index and return the
indices mapping value of said axis to enable readable access to the indices map
of this configuration.
|
int[] |
indicesOfIndex(int index)
The following method calculates the axis indices for an element in the nd-array array
based on a provided "virtual index".
|
int[] |
offset()
The offset is the position of a slice within the n-dimensional
data array of its parent tensor.
|
int |
offset(int i)
The offset is the position of a slice within the n-dimensional
data array of its parent tensor.
|
int |
rank()
|
int[] |
shape()
This method returns an array of axis sizes.
|
int |
shape(int i)
This method receives an axis index and return the
size of the axis.
|
int[] |
spread()
The spread is the access step size of a slice within the n-dimensional
data array of its parent tensor.
|
int |
spread(int i)
The spread is the access step size of a slice within the n-dimensional
data array of its parent tensor.
|
int[] |
strides()
The array returned by this method is used to translate an array
of axis indices to a single ata array index.
|
int |
strides(int i)
This method receives an axis index and returns the
translation value for the targeted axis.
|
_cacheArray, _cached, _simpleReshape, equals, equals, hashCode, newReshaped, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asInlineArray, getIndexToIndexAccessPattern, getLayout, getTraits, has, isCompact, isSimple, isVirtual, none, of, size
public static Simple1DConfiguration construct(int[] shape, int[] strides)
public final int rank()
Tensor
which is equal to the
length of the shape of an nd-array / Tensor
.public final int[] shape()
public final int shape(int i)
i
- The index of the axis whose size ought to be returned.public final int[] indicesMap()
NDConfiguration.indicesMap()
is needed as a basis for translating said scalar index x to an array of indices
for every axis of the tensor represented by this NDConfiguration
.public final int indicesMap(int i)
NDConfiguration.indicesMap()
is needed as a basis for translating said scalar index x to an array of indices
for every axis of the tensor represented by this NDConfiguration
.i
- The index of the axis whose indices map value ought to be returned.public final int[] strides()
NDConfiguration.spread()
and NDConfiguration.offset()
by the NDConfiguration.indexOfIndices(int[])
method.public final int strides(int i)
i
- The index of the axis whose translation ought to be returned.public final int[] spread()
public final int spread(int i)
i
- The dimension / axis index of the dimension / axis whose spread should be returned.public final int[] offset()
public final int offset(int i)
i
- The dimension / axis index of the dimension / axis whose offset should be returned.public final int indexOfIndex(int index)
NDConfiguration
interface, which contain everything
needed to treat a given block of data as a nd-array!index
- The virtual index of the tensor having this configuration.public final int[] indicesOfIndex(int index)
index
- The virtual index of the tensor having this configuration.public final int indexOfIndices(int[] indices)
indices
- The indices for every axis of a given nd-array.public final int indexOfIndices(int d1)
indexOfIndices
in class D1C