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