Eugene N on Mon, 11 Apr 2011 19:47:32 +0200


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

Re: int array to poly (libpari)


Thanks!

Are they different (faster) then polyisirreduc?

Eugene

2011/4/11 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
On Sun, Apr 10, 2011 at 12:48:44PM +0200, Bill Allombert wrote:
> On Sun, Apr 10, 2011 at 12:54:57PM +0300, Eugene N wrote:
> > Hello
> >
> > 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.
> >
> > But in general, how can i initialize a poly from array?
>
> Read section 4.5.10 of the manual:
>
> The following sample function convert poly to a GEN of type t_POL with
> integers coefficients. You can then use FpX_nbfact(x,gen_2)==1 to check for

I forgot that FpX_nbfact assumes x to be squarefree and it probably better to use
FpX_is_irred(x,gen_2) instead.

Cheers,
Bill.