Class TensorValue
java.lang.Object
com.yahoo.searchlib.rankingexpression.evaluation.Value
com.yahoo.searchlib.rankingexpression.evaluation.TensorValue
A Value containing a tensor.
See
Tensor
for definition of a tensor
and the operations supported.- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns this value as a boolean.double
asDouble()
Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a doubleReturns this is mutable, or a mutable copy otherwisecom.yahoo.tensor.Tensor
asTensor()
Returns this as a tensor valuecompare
(TruthOperator operator, Value argument) Perform the comparison specified by the operator between this value and the given valueboolean
Perform the given binary function on this value and the given valueboolean
Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throwint
hashCode()
Returns a hash which only depends on the content of this value.negate()
not()
toString()
com.yahoo.tensor.TensorType
type()
Returns the type of this valueMethods inherited from class com.yahoo.searchlib.rankingexpression.evaluation.Value
asDoubleValue, doubleAsTensor, freeze, isFrozen, isNaN, of, of, parse
-
Constructor Details
-
TensorValue
public TensorValue(com.yahoo.tensor.Tensor value)
-
-
Method Details
-
type
public com.yahoo.tensor.TensorType type()Description copied from class:Value
Returns the type of this value -
asDouble
public double asDouble()Description copied from class:Value
Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a double -
hasDouble
public boolean hasDouble()Description copied from class:Value
Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throw -
asBoolean
public boolean asBoolean()Description copied from class:Value
Returns this value as a boolean. -
negate
-
add
-
subtract
-
multiply
-
divide
-
modulo
-
and
-
or
-
not
-
power
-
asTensor
public com.yahoo.tensor.Tensor asTensor()Description copied from class:Value
Returns this as a tensor value -
compare
Description copied from class:Value
Perform the comparison specified by the operator between this value and the given value -
function
Description copied from class:Value
Perform the given binary function on this value and the given value -
asMutable
Description copied from class:Value
Returns this is mutable, or a mutable copy otherwise -
toString
-
equals
-
hashCode
public int hashCode()Description copied from class:Value
Returns a hash which only depends on the content of this value.
-