Public Methods
LongNdArray | |
static LongNdArray | |
long |
getLong(long... indices)
Returns the long value of the scalar found at the given coordinates.
|
LongNdArray |
read(LongDataBuffer dst)
|
LongNdArray |
setLong(long value, long... indices)
Assigns the long value of the scalar found at the given coordinates.
|
LongNdArray |
write(LongDataBuffer src)
|
Inherited Methods
Public Methods
public long getLong (long... indices)
Returns the long 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:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2
matrix.getLong(0, 1); // succeeds, returns 0L
matrix.getLong(0); // throws IllegalRankException
LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.getLong(); // succeeds, returns 0L
Parameters
indices | coordinates of the scalar to resolve |
---|
Returns
- value of that scalar
public LongNdArray setLong (long value, long... indices)
Assigns the long 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:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2
matrix.setLong(10L, 0, 1); // succeeds
matrix.setLong(10L, 0); // throws IllegalRankException
LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0
scalar.setLong(10L); // succeeds
Parameters
value | value to assign |
---|---|
indices | coordinates of the scalar to assign |
Returns
- this array