Class TensorValue
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.evaluation.Value
-
- com.yahoo.searchlib.rankingexpression.evaluation.TensorValue
-
@Beta public class TensorValue extends Value
A Value containing a tensor. SeeTensor
for definition of a tensor and the operations supported.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description TensorValue(com.yahoo.tensor.Tensor value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Value
add(Value argument)
Value
and(Value argument)
boolean
asBoolean()
Returns this value as a boolean.double
asDouble()
Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a doubleValue
asMutable()
Returns this is mutable, or a mutable copy otherwisecom.yahoo.tensor.Tensor
asTensor()
Returns this as a tensor valueValue
compare(TruthOperator operator, Value argument)
Perform the comparison specified by the operator between this value and the given valueValue
divide(Value argument)
boolean
equals(Object o)
Value
function(Function function, Value arg)
Perform the given binary function on this value and the given valueboolean
hasDouble()
Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throwint
hashCode()
Value
modulo(Value argument)
Value
multiply(Value argument)
Value
negate()
Value
not()
Value
or(Value argument)
Value
power(Value argument)
Value
subtract(Value argument)
String
toString()
com.yahoo.tensor.TensorType
type()
Returns the type of this value-
Methods inherited from class com.yahoo.searchlib.rankingexpression.evaluation.Value
asDoubleValue, doubleAsTensor, freeze, isFrozen, isNaN, of, of, parse
-
-
-
-
Method Detail
-
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.
-
asTensor
public com.yahoo.tensor.Tensor asTensor()
Description copied from class:Value
Returns this as a tensor value
-
compare
public Value compare(TruthOperator operator, Value argument)
Description copied from class:Value
Perform the comparison specified by the operator between this value and the given value
-
function
public Value function(Function function, Value arg)
Description copied from class:Value
Perform the given binary function on this value and the given value
-
asMutable
public Value asMutable()
Description copied from class:Value
Returns this is mutable, or a mutable copy otherwise
-
-