private void ensurePartitionInitialized() { if (indicesPartitionMapping != null) return; if (!isDerivative()) { int[][] ret = new int[structuresOfIndices.length][]; Arrays.fill(ret, 1, ret.length, new int[0]); ret[0] = ArraysUtils.getSeriesFrom0(structuresOfIndices[0].size()); indicesPartitionMapping = ret; } NameDescriptorForTensorField parent = getParent(); StructureOfIndices[] partition = new StructureOfIndices[ArraysUtils.sum(orders) + 1]; partition[0] = parent.getStructureOfIndices(); int i, j; int totalOrder = 1; for (i = 0; i < structuresOfIndices.length - 1; ++i) { for (j = orders[i] - 1; j >= 0; --j) partition[totalOrder++] = parent.getArgStructureOfIndices(i); } indicesPartitionMapping = structuresOfIndices[0].getPartitionMappings(partition); }
for (j = 0; j < orders[i]; ++j) partition[++k] = structuresOfIndices[i + 1].getInverted(); int[][] mapping = baseStructure.getPartitionMappings(partition);