public static ProductContentImpl create(final boolean isDerivativeContent, final Indices indices, final Tensor... data) {
if (isDerivativeContent)
return new ProductContentImpl(isDerivativeContent, indices, ComplexElement.ONE, data);
ComplexElement factor = ComplexElement.ONE;
int i, shift = 0, last = 0;
for (i = 0; i < data.length; ++i)
if (data[i] instanceof TensorNumber) {
factor = factor.multiply(((TensorNumber) data[i]).getValue());
System.arraycopy(data, last, data, last - shift, i - last);
last = i + 1;
++shift;
}
System.arraycopy(data, last, data, last - shift, i - last);