Neill Clift on Sun, 01 Jan 2017 04:47:21 +0100


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

Re: Getting a very large polynomial into pari/gp


On 12/31/2016 9:05 AM, Bill Allombert wrote:
> The libpari library provides a set of functions to deal with polynomials
> over F_p that implement the half-GCD algorithm but they are not directly
> available in GP.
>
> Try:
> install("FpX_gcd","GGG")
> p = 2^64-59;
> a = Pol(read("a.gp"));
> b = Pol(read("b.gp"));
> FpX_gcd(a,b,p)
>
> and actually since p is less than 2^64 there is another function that
> use a more compact representation of polynomials (Vecsmall), but the
> above function will do the conversions for you.
> Read about FpX, FpX_gcd, Flx and Flx_gcd in the documentation.
While the other gcd ran overnight this one failed in an hour.

(18:03) gp > FpX_gcd(a,b,p)
   ***   at top-level: FpX_gcd(a,b,p)
   ***                 ^--------------
   *** FpX_gcd: not enough memory
(19:08) gp >

This seems to be different from the stack size messages I have got 
(stack size set to 64G).
> If you use Windows make sure to use the installer and ot the stand-alone
> binary. Unfortunately install() does not work with the stand-alone
> binary.
I believe I used the installer as I have a desktop icon that's a 
shortcut to pari/gp and it shows installed in control panel.
>
> For this kind of computation, you should consider using the PARI library
> directly.
That was my initial thought as well but my first try at getting the code 
to compile with just the Pari header included gave me errors:

1>../src/kernel/none/divll_pre.h(37): error C2275: 'pari_ulong': illegal 
use of this type as an expression
1>  c:\program files (x86)\pari64-2-9-1\include\pari\parigen.h(17): 
note: see declaration of 'pari_ulong'
1>../src/kernel/none/divll_pre.h(37): error C2146: syntax error: missing 
')' before identifier '__arg'

Thanks.
Neill.