]> www.ginac.de Git - ginac.git/blobdiff - ginac/expairseq.cpp
- fixed a problem where (p\-m*ONE)*(p\-m*ONE) would be automatically simplified
[ginac.git] / ginac / expairseq.cpp
index a18927c26e69933a485f7ddaa2aca91e42acc0c7..d796e4b2e8054440a7566634694849fb19a5dc6e 100644 (file)
@@ -177,7 +177,7 @@ void expairseq::archive(archive_node &n) const
 DEFAULT_UNARCHIVE(expairseq)
 
 //////////
-// functions overriding virtual functions from bases classes
+// functions overriding virtual functions from base classes
 //////////
 
 // public
@@ -311,7 +311,10 @@ ex expairseq::map(map_function & f) const
                ++cit;
        }
 
-       return thisexpairseq(v, f(overall_coeff));
+       if (overall_coeff.is_equal(default_overall_coeff()))
+               return thisexpairseq(v, default_overall_coeff());
+       else
+               return thisexpairseq(v, f(overall_coeff));
 }
 
 ex expairseq::eval(int level) const
@@ -1079,9 +1082,9 @@ void expairseq::combine_same_terms_sorted_seq(void)
                // possible from then on the sequence has changed and must be compacted
                bool must_copy = false;
                while (itin2!=last) {
-                       if ((*itin1).rest.compare(itin2->rest)==0) {
-                               (*itin1).coeff = ex_to<numeric>(itin1->coeff).
-                                                add_dyn(ex_to<numeric>(itin2->coeff));
+                       if (itin1->rest.compare(itin2->rest)==0) {
+                               itin1->coeff = ex_to<numeric>(itin1->coeff).
+                                              add_dyn(ex_to<numeric>(itin2->coeff));
                                if (expair_needs_further_processing(itin1))
                                        needs_further_processing = true;
                                must_copy = true;