while ((current = iterator.next()) != null) {
if (!(current instanceof Product))
continue;
Product cp = (Product) current;
while (true) {
IndexMappingBuffer buffer = null;
final Tensor[] currentIndexless = cp.getIndexless();
int[] indexlessBijection;
IndexlessBijectionsPort indexlessPort = new IndexlessBijectionsPort(fromIndexless, currentIndexless);
while ((indexlessBijection = indexlessPort.take()) != null) {
buffer = IndexMappings.createBijectiveProductPort(fromIndexless, extract(currentIndexless, indexlessBijection)).take();
if (buffer != null)
break;
}
if (buffer == null)
break;
boolean sign = buffer.getSignum();
buffer = null;
ProductContent currentContent = cp.getContent();
final Tensor[] currentData = currentContent.getDataCopy();
int[] dataBijection;
ProductsBijectionsPort dataPort = new ProductsBijectionsPort(fromContent, currentContent);
while ((dataBijection = dataPort.take()) != null) {
buffer = IndexMappings.createBijectiveProductPort(fromData, extract(currentData, dataBijection)).take();
if (buffer != null)
break;
}
if (buffer == null)
break;
buffer.addSignum(sign);
Tensor newTo;
if (symbolic)
newTo = to;
else {
int[] forbidden = new int[iterator.forbiddenIndices().size()];