Karim Belabas on Fri, 30 Dec 2016 11:32:04 +0100

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Getting a very large polynomial into pari/gp

* Neill Clift [2016-12-30 06:17]:
> Hi,
> I want to do a gcd with two polynomials with 16 million coefficients mod 
> a large 64 bit prime.
> Playing with gp with some sparse polynomials it looks like it can do the 
> calculation.
> If I try to read in a dense polynomial of large size though gp overflows 
> its stack (runs out of thread stack space, not a buffer overflow or gp 
> stack).
> I assume your parser is putting a lot of data on the thread stack.
> I am using a command like this:
> gp > a = read("a.gp")
> I am doing this on windows.
> Is there some kind of raw read or similar that will let me get a large 
> polynomial into gp? I can put the data into different formats rather 
> than the symbolic format I am trying currently.

1) The most natural way would be to just (re)create the polynomials
inside gp.

2) If this is not possible, you can try a vector of coefficients. Then
  a = read("a.gp");
  A = Pol(a); \\ leading coeff in a[1], etc.


Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]