Public Methods
ShortNdArray | |
static ShortNdArray | |
short |
getShort(long... indices)
Returns the short value of the scalar found at the given coordinates.
|
ShortNdArray |
read(ShortDataBuffer dst)
|
ShortNdArray |
setShort(short value, long... indices)
Assigns the short value of the scalar found at the given coordinates.
|
ShortNdArray |
write(ShortDataBuffer src)
|
Inherited Methods
Public Methods
public short getShort (long... indices)
Returns the short value of the scalar found at the given coordinates.
To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2
matrix.getShort(0, 1); // succeeds, returns 0.0f
matrix.getShort(0); // throws IllegalRankException
ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getShort(); // succeeds, returns 0.0f
Parameters
indices | coordinates of the scalar to resolve |
---|
Returns
- value of that scalar
public ShortNdArray setShort (short value, long... indices)
Assigns the short value of the scalar found at the given coordinates.
To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2
matrix.setShort(10.0f, 0, 1); // succeeds
matrix.setShort(10.0f, 0); // throws IllegalRankException
ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setShort(10.0f); // succeeds
Parameters
value | value to assign |
---|---|
indices | coordinates of the scalar to assign |
Returns
- this array