if (toIsSymbolic)
newTo = mapping.getSign() ? Tensors.negate(to) : to;
else {
if (possiblyAddsDummies) {
if (forbidden.forbidden == null)
forbidden.forbidden = new TIntHashSet(iterator.getForbidden());
TIntHashSet remainderIndices = new TIntHashSet(forbidden.forbidden);
remainderIndices.addAll(getAllIndicesNamesT(indexlessRemainder));
remainderIndices.addAll(getAllIndicesNamesT(dataRemainderT));
newTo = applyIndexMapping(to, mapping, remainderIndices.toArray());
forbidden.forbidden.addAll(getAllIndicesNamesT(newTo));
} else {
TIntHashSet allowed = new TIntHashSet();
for (int index : indexlessBijection)
allowed.addAll(TensorUtils.getAllDummyIndicesT(content.indexless[index]));
IndicesBuilder ib = new IndicesBuilder();
for (int index : dataBijection) {
allowed.addAll(TensorUtils.getAllDummyIndicesT(currentData[index]));
ib.append(currentData[index]);
}
allowed.addAll(ib.getIndices().getNamesOfDummies());
allowed.removeAll(IndicesUtils.getIndicesNames(mapping.getToData()));
newTo = applyIndexMappingAndRenameAllDummies(to, mapping, allowed.toArray());
}
}
return new SubsResult(newTo, remainder);
}