LongDenseNdArray

public class LongDenseNdArray

Public Methods

LongNdArray
copyTo(NdArray<Long> dst)
static LongNdArray
create(LongDataBuffer buffer, Shape shape)
long
getLong(long... indices)
Returns the long value of the scalar found at the given coordinates.
LongNdArray
LongNdArray
setLong(long value, long... indices)
Assigns the long value of the scalar found at the given coordinates.
LongNdArray

Inherited Methods

Public Methods

public LongNdArray copyTo (NdArray<Long> dst)

public static LongNdArray create (LongDataBuffer buffer, Shape shape)

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

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

public LongNdArray write (LongDataBuffer src)