// }
@Override
Tensor newTo_(Tensor currentNode, SubstitutionIterator iterator) {
Product product = (Product) currentNode;
Complex factor = product.getFactor();
PContent content = new PContent(product.getIndexless(), product.getDataSubProduct());
//TODO getForbidden only if necessary!!!!!!!!!!!!!!!!!
TIntHashSet forbidden = new TIntHashSet(iterator.getForbidden());
SubsResult subsResult = atomicSubstitute(content, forbidden);
if (subsResult == null)
return currentNode;
List<Tensor> newTos = new ArrayList<>();
while (true) {
if (subsResult == null)
break;
factor = factor.divide(fromFactor);
newTos.add(subsResult.newTo);
content = subsResult.remainder;
subsResult = atomicSubstitute(content, forbidden);
}
Tensor[] result = new Tensor[newTos.size() + content.indexless.length + 2];