]> www.ginac.de Git - ginac.git/commitdiff
- 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 ba6b6e187fde34875d90531bd8f73a6fb8238b73..0698b9065da29a92604c9e76617459259ced1af7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 This file records noteworthy changes.
 
 0.9.3 (<insert date>)
 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)
 * lsolve() accepts an algorithmic hint as parameter.
 
 0.9.2 (31 July 2001)
index 77fdcbef7ec97aaac9a5c2440cea0ded98ce17a6..837448b84ebb87a91ed98c8783e3d23dfd8406da 100644 (file)
@@ -19,9 +19,9 @@ dnl (don't we all *love* M4?)...
 
 GINACLIB_MAJOR_VERSION=0
 GINACLIB_MINOR_VERSION=9
 
 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)
 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION
 
 AC_SUBST(GINACLIB_MAJOR_VERSION)
index 0fae94bc7360f348879ef3caff8be1e8f0c7eb10..7ae30a9c7266a17e5d9481b1776cb975e8079783 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) {
        
        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();
                deriv = deriv.diff(s).expand();
-               if (deriv.is_zero()) {
-                       // Series terminates
+               if (deriv.is_zero())  // Series terminates
                        return pseries(r, seq);
                        return pseries(r, seq);
-               }
+
                coeff = deriv.subs(r);
                if (!coeff.is_zero())
                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())
        }
        
        // 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);
 }
 
        return pseries(r, seq);
 }