- doc update: motivate use of .expand() in basic::series().
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 16 Aug 2001 22:47:54 +0000 (22:47 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 16 Aug 2001 22:47:54 +0000 (22:47 +0000)
NEWS
configure.in
ginac/pseries.cpp

diff --git a/NEWS b/NEWS
index ba6b6e1..0698b90 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 This file records noteworthy changes.
 
 0.9.3 (<insert date>)
+* series expansion now much more consistent for small order expansion.
 * lsolve() accepts an algorithmic hint as parameter.
 
 0.9.2 (31 July 2001)
index 77fdcbe..837448b 100644 (file)
@@ -19,9 +19,9 @@ dnl (don't we all *love* M4?)...
 
 GINACLIB_MAJOR_VERSION=0
 GINACLIB_MINOR_VERSION=9
-GINACLIB_MICRO_VERSION=2
-GINACLIB_INTERFACE_AGE=1
-GINACLIB_BINARY_AGE=1
+GINACLIB_MICRO_VERSION=3
+GINACLIB_INTERFACE_AGE=0
+GINACLIB_BINARY_AGE=0
 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION
 
 AC_SUBST(GINACLIB_MAJOR_VERSION)
index 0fae94b..7ae30a9 100644 (file)
@@ -499,21 +499,23 @@ ex basic::series(const relational & r, int order, unsigned options) const
        
        int n;
        for (n=1; n<order; ++n) {
-               fac = fac.mul(numeric(n));
+               fac = fac.mul(n);
+               // We need to test for zero in order to see if the series terminates.
+               // The problem is that there is no such thing as a perfect test for
+               // zero.  Expanding the term occasionally helps a little...
                deriv = deriv.diff(s).expand();
-               if (deriv.is_zero()) {
-                       // Series terminates
+               if (deriv.is_zero())  // Series terminates
                        return pseries(r, seq);
-               }
+
                coeff = deriv.subs(r);
                if (!coeff.is_zero())
-                       seq.push_back(expair(fac.inverse() * coeff, numeric(n)));
+                       seq.push_back(expair(fac.inverse() * coeff, n));
        }
        
        // Higher-order terms, if present
        deriv = deriv.diff(s);
        if (!deriv.expand().is_zero())
-               seq.push_back(expair(Order(_ex1()), numeric(n)));
+               seq.push_back(expair(Order(_ex1()), n));
        return pseries(r, seq);
 }