private static List<Integer> toIterationOrder(List<String> dimensionNames, TensorType type) {
            if (dimensionNames == null) return completeIterationOrder(type.rank());

            List<Integer> iterationDimensions = new ArrayList<>(type.rank());
            for (int i = 0; i < type.rank(); i++)
                iterationDimensions.add(type.rank() - 1 - type.indexOfDimension(dimensionNames.get(i)).get());
            return iterationDimensions;
        }
Create indexes from a type containing bound indexed dimensions only.

@throws IllegalStateException if the type contains dimensions which are not bound and indexed
vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java