public class BooleanDenseNdArray extends AbstractDenseNdArray<Boolean,BooleanNdArray> implements BooleanNdArray
dimensions| Modifier | Constructor and Description |
|---|---|
protected |
BooleanDenseNdArray(BooleanDataBuffer buffer,
Shape shape) |
| Modifier and Type | Method and Description |
|---|---|
protected BooleanDataBuffer |
buffer() |
BooleanNdArray |
copyTo(NdArray<Boolean> dst)
Copy the content of this array to the destination array.
|
static BooleanNdArray |
create(BooleanDataBuffer buffer,
Shape shape) |
boolean |
getBoolean(long... indices)
Returns the boolean value of the scalar found at the given coordinates.
|
BooleanNdArray |
read(BooleanDataBuffer dst) |
BooleanNdArray |
setBoolean(boolean value,
long... indices)
Assigns the boolean value of the scalar found at the given coordinates.
|
BooleanNdArray |
write(BooleanDataBuffer src) |
elements, equals, get, getObject, hashCode, read, set, setObject, slice, slice, slowCopyTo, writedimensions, scalars, shape, slowEquals, slowHashCodeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitprotected BooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape)
public static BooleanNdArray create(BooleanDataBuffer buffer, Shape shape)
public boolean getBoolean(long... indices)
BooleanNdArrayTo 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
getBoolean in interface BooleanNdArrayindices - coordinates of the scalar to resolvepublic BooleanNdArray setBoolean(boolean value, long... indices)
BooleanNdArrayTo 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
setBoolean in interface BooleanNdArrayvalue - the value to assignindices - coordinates of the scalar to assignpublic BooleanNdArray copyTo(NdArray<Boolean> dst)
NdArrayThe NdArray.shape() of the destination array must be equal to the shape of this array, or
an exception is thrown. After the copy, the content of both arrays can be altered
independently, without affecting each other.
copyTo in interface BooleanNdArraycopyTo in interface NdArray<Boolean>dst - array to receive a copy of the content of this arraypublic BooleanNdArray read(BooleanDataBuffer dst)
read in interface BooleanNdArraypublic BooleanNdArray write(BooleanDataBuffer src)
write in interface BooleanNdArrayprotected BooleanDataBuffer buffer()
buffer in class AbstractDenseNdArray<Boolean,BooleanNdArray>Copyright © 2015–2020. All rights reserved.