- exvector sub_expanded_seq;
- intvector positions_of_adds;
- intvector number_of_add_operands;
-
- exvector expanded_seq=expandchildren(options);
-
- positions_of_adds.resize(expanded_seq.size());
- number_of_add_operands.resize(expanded_seq.size());
-
- int number_of_adds=0;
- int number_of_expanded_terms=1;
-
- unsigned current_position=0;
- exvector::const_iterator last=expanded_seq.end();
+ // First, expand the children
+ exvector expanded_seq = expandchildren(options);
+
+ // Now, look for all the factors that are sums and remember their
+ // position and number of terms. One remark is in order here: we do not
+ // take into account the overall_coeff of the add objects. This is
+ // because in GiNaC, all terms of a sum must be of the same type, so
+ // a non-zero overall_coeff (which can only be numeric) would imply that
+ // the sum only has commutative terms. But then it would never appear
+ // as a factor of an ncmul.
+ intvector positions_of_adds(expanded_seq.size());
+ intvector number_of_add_operands(expanded_seq.size());
+
+ int number_of_adds = 0;
+ int number_of_expanded_terms = 1;
+
+ unsigned current_position = 0;
+ exvector::const_iterator last = expanded_seq.end();