if (tensor instanceof SimpleTensor)
return new SplitNumber(TensorNumber.createONE(), tensor);
if (tensor instanceof TensorNumber)
return new SplitNumber(TensorNumber.createONE(), tensor);
if (tensor instanceof Product) {
TensorNumber number = TensorNumber.createONE();
TensorIterator iterator = tensor.iterator();
Tensor current;
while (iterator.hasNext()) {
current = iterator.next();
if (current instanceof TensorNumber) {
number.multiply((TensorNumber) current);
iterator.remove();
}
}
return new SplitNumber(number, tensor.equivalent());
}