ByteDenseNdArray

public class ByteDenseNdArray

Public Methods

ByteNdArray
copyTo(NdArray<Byte> dst)
static ByteNdArray
create(ByteDataBuffer buffer, Shape shape)
byte
getByte(long... indices)
Returns the byte value of the scalar found at the given coordinates.
ByteNdArray
ByteNdArray
setByte(byte value, long... indices)
Assigns the byte value of the scalar found at the given coordinates.
ByteNdArray

Inherited Methods

Public Methods

public ByteNdArray copyTo (NdArray<Byte> dst)

public static ByteNdArray create (ByteDataBuffer buffer, Shape shape)

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 read (ByteDataBuffer dst)

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

public ByteNdArray write (ByteDataBuffer src)