BooleanDenseNdArray

public class BooleanDenseNdArray

Public Methods

BooleanNdArray
copyTo(NdArray<Boolean> dst)
static BooleanNdArray
create(BooleanDataBuffer buffer, Shape shape)
boolean
getBoolean(long... indices)
Returns the boolean value of the scalar found at the given coordinates.
BooleanNdArray
BooleanNdArray
setBoolean(boolean value, long... indices)
Assigns the boolean value of the scalar found at the given coordinates.
BooleanNdArray

Inherited Methods

Public Methods

public BooleanNdArray copyTo (NdArray<Boolean> dst)

public static BooleanNdArray create (BooleanDataBuffer buffer, Shape shape)

public boolean getBoolean (long... indices)

Returns the boolean 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:

BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
  matrix.getBoolean(0, 1);  // succeeds, returns false
  matrix.getBoolean(0);  // throws IllegalRankException

  BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.getBoolean();  // succeeds, returns false
 

Parameters
indices coordinates of the scalar to resolve
Returns
  • value of that scalar

public BooleanNdArray read (BooleanDataBuffer dst)

public BooleanNdArray setBoolean (boolean value, long... indices)

Assigns the boolean 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:

BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
  matrix.setBoolean(true, 0, 1);  // succeeds
  matrix.setBoolean(true, 0);  // throws IllegalRankException

  BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
  scalar.setBoolean(true);  // succeeds
 

Parameters
value the value to assign
indices coordinates of the scalar to assign
Returns
  • this array

public BooleanNdArray write (BooleanDataBuffer src)