Class IndexedTensor.SubspaceIterator

  • All Implemented Interfaces:
    Iterator<Tensor.Cell>
    Enclosing class:
    IndexedTensor

    public final class IndexedTensor.SubspaceIterator
    extends Object
    implements Iterator<Tensor.Cell>
    An iterator over a subspace of this tensor. This is exposed to allow clients to query the size. NOTE THAT the Cell returned by next is only valid until the next() call is made. This is a concession to performance due to this typically being used in inner loops.
    • Method Detail

      • size

        public long size()
        Returns the total number of cells in this subspace
      • address

        public TensorAddress address()
        Returns the address of the cell this currently points to (which may be an invalid position)
      • reset

        public void reset()
        Rewind this iterator to the first element