Class BooleanDenseNdArray
java.lang.Object
org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Boolean, BooleanNdArray>
org.tensorflow.ndarray.impl.dense.BooleanDenseNdArray
- All Implemented Interfaces:
BooleanNdArray, NdArray<Boolean>, Shaped
public class BooleanDenseNdArray
extends AbstractDenseNdArray<Boolean, BooleanNdArray>
implements BooleanNdArray
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape) -
Method Summary
Modifier and TypeMethodDescriptionprotected BooleanDataBufferbuffer()copyTo(BooleanDataBuffer dst) Copy the content of this array to the destination array.static BooleanNdArraycreate(BooleanDataBuffer buffer, Shape shape) booleangetBoolean(long... indices) Returns the boolean value of the scalar found at the given coordinates.scalars()Returns a sequence of all scalars in this array.setBoolean(boolean value, long... indices) Assigns the boolean value of the scalar found at the given coordinates.shape()protected booleanslowEquals(NdArray<?> array) protected intMethods inherited from class AbstractDenseNdArray
copyFrom, copyTo, elements, equals, get, getObject, hashCode, set, setObject, slice, slice, slowCopyTo, toString, withShapeModifier and TypeMethodDescriptioncopyFrom(DataBuffer<Boolean> src) Copy the content of the source buffer into this N-dimensional array.copyTo(DataBuffer<Boolean> dst) Copy the content of this N-dimensional array into the destination buffer.elements(int dimensionIdx) Returns a sequence of all elements at a given dimension.booleanChecks equality between n-dimensional arrays.get(long... coords) Returns the N-dimensional element of this array at the given coordinates.getObject(long... coords) Returns the value of the scalar found at the given coordinates.inthashCode()Assigns the value of the N-dimensional element found at the given coordinates.Assigns the value of the scalar found at the given coordinates.slice(long position, DimensionalSpace sliceDimensions) Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.protected voidslowCopyTo(NdArray<Boolean> array) toString()A String showing the type and shape of this dense ndarray.Returns a new N-dimensional view of this array with the givenshape.Methods inherited from interface BooleanNdArray
copyFrom, copyTo, elements, get, getObject, scalars, set, setObject, slice, withShapeModifier and TypeMethodDescriptioncopyFrom(DataBuffer<Boolean> src) Copy the content of the source buffer into this N-dimensional array.copyTo(DataBuffer<Boolean> dst) Copy the content of this N-dimensional array into the destination buffer.elements(int dimensionIdx) Returns a sequence of all elements at a given dimension.get(long... coordinates) Returns the N-dimensional element of this array at the given coordinates.default BooleangetObject(long... coordinates) Returns the value of the scalar found at the given coordinates.scalars()Returns a sequence of all scalars in this array.Assigns the value of the N-dimensional element found at the given coordinates.default BooleanNdArrayAssigns the value of the scalar found at the given coordinates.Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to the given index selectors.Returns a new N-dimensional view of this array with the givenshape.Methods inherited from interface NdArray
streamOfObjectsModifier and TypeMethodDescriptionRetrieve all scalar values of this array as a stream of objects.
-
Field Details
-
dimensions
-
-
Constructor Details
-
BooleanDenseNdArray
-
-
Method Details
-
create
-
getBoolean
public boolean getBoolean(long... indices) Description copied from interface:BooleanNdArrayReturns 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- Specified by:
getBooleanin interfaceBooleanNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setBoolean
Description copied from interface:BooleanNdArrayAssigns 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- Specified by:
setBooleanin interfaceBooleanNdArray- Parameters:
value- the value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
Description copied from interface:NdArrayCopy the content of this array to the destination array.The
Shaped.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.- Specified by:
copyToin interfaceBooleanNdArray- Specified by:
copyToin interfaceNdArray<Boolean>- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
copyTo
- Specified by:
copyToin interfaceBooleanNdArray
-
copyFrom
- Specified by:
copyFromin interfaceBooleanNdArray
-
buffer
- Specified by:
bufferin classAbstractDenseNdArray<Boolean, BooleanNdArray>
-
dimensions
-
shape
-
scalars
Description copied from interface:NdArrayReturns a sequence of all scalars in this array.This is equivalent to call
elements(shape().numDimensions() - 1) -
slowHashCode
protected int slowHashCode() -
slowEquals
-