@Override
    public Iterator<Double> valueIterator() {
        return new Iterator<>() {

            final Iterator<DenseSubspace> blockIterator = index.denseSubspaces.iterator();
            double[] currentBlock = null;
            int currOffset = index.denseSubspaceSize;

            @Override
            public boolean hasNext() {
                return (currOffset < index.denseSubspaceSize || blockIterator.hasNext());
            }

            @Override
            public Double next() {
                if (currOffset == index.denseSubspaceSize) {
                    currentBlock = blockIterator.next().cells;
                    currOffset = 0;
                }
                return currentBlock[currOffset++];
            }
        };
    }
Returns an iterator over the values of this tensor.
The iteration order is the same as for cellIterator.
vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java