Karim.Belabas on Tue, 29 May 2001 14:56:06 +0200 (MET DST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Patch: memory bug in `factor' interface to polroots |
I have received the following bug report [from XIAO Gang], affecting (at least) stable versions 2.1.0 and 2.1.1. > Problem: factorization of polynomials with complex coefficients can no > longuer be done. > > ? factor(x^4-2.0*I) > *** significant pointers are lost in gerepile !!! (please report) > ? factor(x^2+1.0*I) > *** lbot>ltop in gerepile. Here is the corresponding patch: *** src/basemath/polarit2.c 2001/03/26 11:56:37 1.42.2.2 --- src/basemath/polarit2.c 2001/05/29 12:47:28 *************** *** 1656,1662 **** case t_INTMOD: return factmod(x,p); case t_COMPLEX: y=cgetg(3,t_MAT); lx=lgef(x)-2; v=varn(x); ! p1=roots(x,pa); tetpil=avma; p2=cgetg(lx,t_COL); for (i=1; i<lx; i++) p2[i] = (long)poldeg1(v, gneg((GEN)p1[i]), gun); --- 1656,1662 ---- case t_INTMOD: return factmod(x,p); case t_COMPLEX: y=cgetg(3,t_MAT); lx=lgef(x)-2; v=varn(x); ! av = avma; p1=roots(x,pa); tetpil=avma; p2=cgetg(lx,t_COL); for (i=1; i<lx; i++) p2[i] = (long)poldeg1(v, gneg((GEN)p1[i]), gun); Karim. -- Karim Belabas email: Karim.Belabas@math.u-psud.fr Dep. de Mathematiques, Bat. 425 Universite Paris-Sud Tel: (00 33) 1 69 15 57 48 F-91405 Orsay (France) Fax: (00 33) 1 69 15 60 19 -- PARI/GP Home Page: http://www.parigp-home.de/