public class SimpleBooleanTensor extends java.lang.Object implements BooleanTensor
Tensor.FlattenedView<T>
ONE_BY_ONE_SHAPE, SCALAR_SHAPE, SCALAR_STRIDE
Constructor and Description |
---|
SimpleBooleanTensor(boolean constant) |
SimpleBooleanTensor(boolean[] data,
long[] shape) |
SimpleBooleanTensor(boolean constant,
long[] shape) |
SimpleBooleanTensor(long[] shape) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
and, concat, create, create, falses, or, stack, trues, vector
asFlatList, create, createFilled, elementwiseEquals, elementwiseEquals, getValue, hasSameShapeAs, hasSameShapeAs, isLengthOne, isMatrix, isScalar, isVector
public SimpleBooleanTensor(boolean[] data, long[] shape)
data
- tensor data used c orderingshape
- desired shape of tensorpublic SimpleBooleanTensor(boolean constant)
constant
- constant boolean value to fill shapepublic SimpleBooleanTensor(long[] shape)
shape
- shape to use as place holderpublic SimpleBooleanTensor(boolean constant, long[] shape)
constant
- constant boolean value to fill shapeshape
- desired shape of tensorpublic BooleanTensor reshape(long... newShape)
reshape
in interface BooleanTensor
reshape
in interface Tensor<java.lang.Boolean>
public BooleanTensor and(BooleanTensor that)
and
in interface io.improbable.keanu.kotlin.BooleanOperators<BooleanTensor>
and
in interface BooleanTensor
public BooleanTensor or(BooleanTensor that)
or
in interface io.improbable.keanu.kotlin.BooleanOperators<BooleanTensor>
or
in interface BooleanTensor
public BooleanTensor xor(BooleanTensor that)
xor
in interface BooleanTensor
public BooleanTensor not()
not
in interface io.improbable.keanu.kotlin.BooleanOperators<BooleanTensor>
not
in interface BooleanTensor
public DoubleTensor doubleWhere(DoubleTensor trueValue, DoubleTensor falseValue)
doubleWhere
in interface BooleanTensor
public IntegerTensor integerWhere(IntegerTensor trueValue, IntegerTensor falseValue)
integerWhere
in interface BooleanTensor
public BooleanTensor booleanWhere(BooleanTensor trueValue, BooleanTensor falseValue)
booleanWhere
in interface BooleanTensor
public <T,TENSOR extends Tensor<T>> TENSOR where(TENSOR trueValue, TENSOR falseValue)
where
in interface BooleanTensor
public BooleanTensor andInPlace(BooleanTensor that)
andInPlace
in interface BooleanTensor
public BooleanTensor orInPlace(BooleanTensor that)
orInPlace
in interface BooleanTensor
public BooleanTensor xorInPlace(BooleanTensor that)
xorInPlace
in interface BooleanTensor
public BooleanTensor notInPlace()
notInPlace
in interface BooleanTensor
public boolean allTrue()
allTrue
in interface BooleanTensor
public boolean allFalse()
allFalse
in interface BooleanTensor
public DoubleTensor toDoubleMask()
toDoubleMask
in interface BooleanTensor
public IntegerTensor toIntegerMask()
toIntegerMask
in interface BooleanTensor
public BooleanTensor slice(int dimension, long index)
slice
in interface BooleanTensor
slice
in interface Tensor<java.lang.Boolean>
public boolean isShapePlaceholder()
isShapePlaceholder
in interface Tensor<java.lang.Boolean>
public java.lang.Boolean getValue(long... index)
public BooleanTensor setValue(java.lang.Boolean value, long... index)
public java.lang.Boolean scalar()
public BooleanTensor duplicate()
duplicate
in interface BooleanTensor
duplicate
in interface Tensor<java.lang.Boolean>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Tensor.FlattenedView<java.lang.Boolean> getFlattenedView()
getFlattenedView
in interface Tensor<java.lang.Boolean>
public BooleanTensor elementwiseEquals(java.lang.Boolean value)
elementwiseEquals
in interface Tensor<java.lang.Boolean>
public double[] asFlatDoubleArray()
asFlatDoubleArray
in interface Tensor<java.lang.Boolean>
public int[] asFlatIntegerArray()
asFlatIntegerArray
in interface Tensor<java.lang.Boolean>
public java.lang.Boolean[] asFlatArray()
asFlatArray
in interface Tensor<java.lang.Boolean>
public boolean[] asFlatBooleanArray()
asFlatBooleanArray
in interface BooleanTensor