Eugene N on Sun, 10 Apr 2011 12:01:53 +0200

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

int array to poly (libpari)


I am writing some C code, wich will check if a polynomial is irreducible (with libpari gpolisirreducible). 

Poly will be in the form of int poly[]= {m,m-1,...,0};  (over GF[2])

I am new to pari, and so far i only have seen gp_read_str as means of initializing a GEN object from C string.

If m is constatnt, i guess one can use something like
 sprintf(str, "Mod(1,2)*x^%d + Mod(1,2)*x^%d ... +Mod(1,2)", poly[m], poly[m-1], ...)

But in general, how can i initialize a poly from array? 

PS: i would also like to know, how to initialize a pari bignum from openssl-style hex-string?