ShortDenseNdArray

public class ShortDenseNdArray

Public Methods

ShortNdArray
copyTo(NdArray<Short> dst)
static ShortNdArray
create(ShortDataBuffer buffer, Shape shape)
short
getShort(long... indices)
Returns the short value of the scalar found at the given coordinates.
ShortNdArray
ShortNdArray
setShort(short value, long... indices)
Assigns the short value of the scalar found at the given coordinates.
ShortNdArray

Inherited Methods

Public Methods

public ShortNdArray copyTo (NdArray<Short> dst)

public static ShortNdArray create (ShortDataBuffer buffer, Shape shape)

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

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

public ShortNdArray write (ShortDataBuffer src)