java.lang.Object
com.yahoo.searchlib.rankingexpression.evaluation.Value
com.yahoo.searchlib.rankingexpression.evaluation.TensorValue

public class TensorValue extends Value
A Value containing a tensor. See Tensor for definition of a tensor and the operations supported.
Author:
bratseth
  • 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
      Specified by:
      type in class 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
      Specified by:
      asDouble in class Value
    • 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
      Specified by:
      hasDouble in class Value
    • asBoolean

      public boolean asBoolean()
      Description copied from class: Value
      Returns this value as a boolean.
      Specified by:
      asBoolean in class Value
    • negate

      public Value negate()
      Specified by:
      negate in class Value
    • add

      public Value add(Value argument)
      Specified by:
      add in class Value
    • subtract

      public Value subtract(Value argument)
      Specified by:
      subtract in class Value
    • multiply

      public Value multiply(Value argument)
      Specified by:
      multiply in class Value
    • divide

      public Value divide(Value argument)
      Specified by:
      divide in class Value
    • modulo

      public Value modulo(Value argument)
      Specified by:
      modulo in class Value
    • and

      public Value and(Value argument)
      Specified by:
      and in class Value
    • or

      public Value or(Value argument)
      Specified by:
      or in class Value
    • not

      public Value not()
      Specified by:
      not in class Value
    • power

      public Value power(Value argument)
      Specified by:
      power in class Value
    • asTensor

      public com.yahoo.tensor.Tensor asTensor()
      Description copied from class: Value
      Returns this as a tensor value
      Specified by:
      asTensor in class 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
      Specified by:
      compare in class 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
      Specified by:
      function in class Value
    • asMutable

      public Value asMutable()
      Description copied from class: Value
      Returns this is mutable, or a mutable copy otherwise
      Specified by:
      asMutable in class Value
    • toString

      public String toString()
      Specified by:
      toString in class Value
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class Value
    • hashCode

      public int hashCode()
      Description copied from class: Value
      Returns a hash which only depends on the content of this value.
      Specified by:
      hashCode in class Value