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 TypeMethodDescriptionapproxEqual
(Value argument) boolean
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 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.largerOrEqual
(Value argument) negate()
not()
smallerOrEqual
(Value argument) 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
-
not
-
or
-
and
-
largerOrEqual
- Specified by:
largerOrEqual
in classValue
-
larger
-
smallerOrEqual
- Specified by:
smallerOrEqual
in classValue
-
smaller
-
approxEqual
- Specified by:
approxEqual
in classValue
-
notEqual
-
equal
-
add
-
subtract
-
multiply
-
divide
-
modulo
-
power
-
asTensor
public com.yahoo.tensor.Tensor asTensor()Description copied from class:Value
Returns this as a tensor 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.
-