]> www.ginac.de Git - ginac.git/commitdiff
Synced to HEAD:
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Mon, 15 Oct 2007 23:48:47 +0000 (23:48 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Mon, 15 Oct 2007 23:48:47 +0000 (23:48 +0000)
- Apparently, in ~ 30% of calls to mul::expand the expression is monomial.
Expanding monomials should be done as fast as possible [Sheplyakov].

ginac/power.cpp

index 676b862fc9ba4aa71a482aa8f0500048ebb476ad..bbcb45368bcf6465f1409cf78d0945b2606df6a1 100644 (file)
@@ -916,7 +916,7 @@ ex power::expand_mul(const mul & m, const numeric & n, unsigned options, bool fr
        }
 
        // 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);