]> www.ginac.de Git - ginac.git/commitdiff
Fixed ldegree handling (last fix hopefully, no known bugs left)
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Fri, 20 Feb 2004 19:06:50 +0000 (19:06 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Fri, 20 Feb 2004 19:06:50 +0000 (19:06 +0000)
ginac/pseries.cpp

index 9a247231eeafca811e90878d1eec3878b2942669..23c4f94ba81c604cc5e2f25fe1ce0953d622a1a1 100644 (file)
@@ -770,7 +770,7 @@ ex mul::series(const relational & r, int order, unsigned options) const
                
                ex buf = recombine_pair_to_ex(*it);
                
-               int real_ldegree = buf.expand().ldegree(sym);
+               int real_ldegree = buf.expand().ldegree(sym-r.rhs());
                if (real_ldegree == 0) {
                        int orderloop = 0;
                        do {
@@ -789,10 +789,7 @@ ex mul::series(const relational & r, int order, unsigned options) const
        for (epvector::const_iterator it=itbeg; it!=itend; ++it, ++itd) {
 
                // do series expansion with adjusted order
-               degsum -= *itd;
-               ex op = recombine_pair_to_ex(*it).series(r, order-degsum, options);
-               // ldegree might have changed ...
-               degsum += op.ldegree(sym);
+               ex op = recombine_pair_to_ex(*it).series(r, order-degsum+(*itd), options);
 
                // Series multiplication
                if (it==itbeg)
@@ -942,7 +939,7 @@ ex power::series(const relational & r, int order, unsigned options) const
        int intexp = ex_to<numeric>(exponent).to_int();
        const ex& sym = r.lhs();
        // find existing minimal degree
-       int real_ldegree = basis.expand().ldegree(sym);
+       int real_ldegree = basis.expand().ldegree(sym-r.rhs());
        if (real_ldegree == 0) {
                int orderloop = 0;
                do {