Class IndexedTensor.Indexes

java.lang.Object
com.yahoo.tensor.IndexedTensor.Indexes
Enclosing class:
IndexedTensor

public abstract static class IndexedTensor.Indexes extends Object
An array of indexes into this tensor which are able to find the next index in the value order. next() can be called once per element in the dimensions we iterate over. It must be called once before accessing the first position.
  • Field Details

    • indexes

      protected final long[] indexes
  • Method Details

    • of

      public static IndexedTensor.Indexes of(TensorType type)
      Create indexes from a type containing bound indexed dimensions only.
      Throws:
      IllegalStateException - if the type contains dimensions which are not bound and indexed
    • of

      public static IndexedTensor.Indexes of(TensorType type, List<String> iterateDimensionOrder)
    • of

      public static IndexedTensor.Indexes of(DimensionSizes sizes)
    • toAddress

      public TensorAddress toAddress()
      Returns the address of the current position of these indexes
    • indexesCopy

      public long[] indexesCopy()
    • indexesForReading

      public long[] indexesForReading()
      Returns a copy of the indexes of this which must not be modified
    • toSourceValueIndex

      public long toSourceValueIndex()
    • toList

      public List<Long> toList()
      Returns an immutable list containing a copy of the indexes in this
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • size

      public abstract long size()
    • next

      public abstract void next()
    • hasNext

      public abstract boolean hasNext()
      Returns whether further values are available by calling next()