Unknown on Tue Jun 10 22:09:52 2008 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[no subject] |
You can reduce that amount, killing the factor 3, by adding the following statement at the end of the inner loop [ for (k=i+1; k<=nbli; k++)... ] if (low_stack(lim, stack_lim(av,1))) { GEN *gptr[2]; gptr[0]=&a; gptr[1]=&b; if(DEBUGMEM>1) err(warnmem,"gauss. i=%ld",i); gerepilemany(av,gptr,2); p = gcoeff(a,i,i); } It's going to take forever (the whole matrix is copied anew each time GC occurs), but it will work... Of course, the right way to do this would be to do everything in place, overwriting the old entries as we produce new ones. Unfortunately, if it would be possible in a special purpose function called only when entries are floating point real numbers (type t_REAL), it's not possible in a generic function like matsolve/gauss. All in all, the function (as most of the linear algebra package) is designed to work quickly, generically, on matrices of small dimension (< 400 say). It's not at all space efficient. Hope this helps, 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/