- Apparently, in ~ 30% of calls to mul::expand the expression is monomial.
Expanding monomials should be done as fast as possible [Sheplyakov].
}
// Leave it to multiplication since dummy indices have to be renamed
}
// Leave it to multiplication since dummy indices have to be renamed
- if (get_all_dummy_indices(m).size() > 0 && n.is_positive()) {
+ if (m.info(info_flags::has_indices) && (get_all_dummy_indices(m).size() > 0) && n.is_positive()) {
ex result = m;
for (int i=1; i < n.to_int(); i++)
result *= rename_dummy_indices_uniquely(m,m);
ex result = m;
for (int i=1; i < n.to_int(); i++)
result *= rename_dummy_indices_uniquely(m,m);