X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpseries.cpp;h=d416b3500ca11dbe9bb60fb121043e042df62669;hp=bc04b1868a73663ff0dd3983df25a521133c9798;hb=db52ae4c832e9a9981ecf78ecc3c9e59f461d8e4;hpb=dc0683db2b9fcb2b3533942cbfd497f17bda0122 diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index bc04b186..d416b350 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -4,7 +4,7 @@ * methods for series expansion. */ /* - * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -1100,12 +1100,12 @@ ex integral::series(const relational & r, int order, unsigned options) const fexpansion.reserve(fseries.nops()); for (size_t i=0; i(fseries).coeffop(i); - fexpansion.push_back(expair( - currcoeff == Order(_ex1) - ? currcoeff - : integral(x, a.subs(r), b.subs(r), currcoeff), - ex_to(fseries).exponop(i) - )); + currcoeff = (currcoeff == Order(_ex1)) + ? currcoeff + : integral(x, a.subs(r), b.subs(r), currcoeff); + if (currcoeff != 0) + fexpansion.push_back( + expair(currcoeff, ex_to(fseries).exponop(i))); } // Expanding lower boundary @@ -1118,7 +1118,7 @@ ex integral::series(const relational & r, int order, unsigned options) const break; ex currexpon = ex_to(fseries).exponop(i); int orderforf = order-ex_to(currexpon).to_int()-1; - currcoeff=currcoeff.series(r, orderforf); + currcoeff = currcoeff.series(r, orderforf); ex term = ex_to(aseries).power_const(ex_to(currexpon+1),order); term = ex_to(term).mul_const(ex_to(-1/(currexpon+1))); term = ex_to(term).mul_series(ex_to(currcoeff)); @@ -1134,7 +1134,7 @@ ex integral::series(const relational & r, int order, unsigned options) const break; ex currexpon = ex_to(fseries).exponop(i); int orderforf = order-ex_to(currexpon).to_int()-1; - currcoeff=currcoeff.series(r, orderforf); + currcoeff = currcoeff.series(r, orderforf); ex term = ex_to(bseries).power_const(ex_to(currexpon+1),order); term = ex_to(term).mul_const(ex_to(1/(currexpon+1))); term = ex_to(term).mul_series(ex_to(currcoeff));