| 
	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)
	 | 
 
- To: pari-users@list.cr.yp.to
 
- Subject: int array to poly (libpari)
 
- From: Eugene N <neverov.biks.07.1@gmail.com>
 
- Date: Sun, 10 Apr 2011 12:54:57 +0300
 
- Delivery-date: Sun, 10 Apr 2011 12:01:53 +0200
 
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=gamma;        h=domainkey-signature:mime-version:date:message-id:subject:from:to         :content-type;        bh=UeyBIQ4OucobvJp7cxsC4sK7UtfGDqfY+J/g+FPn8dk=;        b=oxGzkpObBxr7QfKnGL2HMGu1E/yBW/anq6ZxPnw+9jlUWe48a7Aj56Tc5cTSBv8Nho         iFpLxDeFQH3WAv529ypJPpwSxiPueYhhQTObAEM62rpjk9vLavKAHZkoqbk0kifOXkQA         AuneRUuLSzDX25s4QSsfq5ghu6LJuJo8eVmZw=
 
- Domainkey-signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;        h=mime-version:date:message-id:subject:from:to:content-type;        b=TDHqH8afoywdupZd0My45JG38mELubY+Gprn26ymPQoUAM5CjYjT/kX7Kjlc/VXMy+         BcKzZbCIxwGZuOrrXkIUM/96wrdeIlo/yrBJj6kub2o4EDgdxvkYLBo2rBlihBOTDk+L         ZX5Jfg0QezDLaPQ8frTaMYJGpQb3a6Kn7lgNI=
 
- Mailing-list: contact pari-users-help@list.cr.yp.to; run by ezmlm
 
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.
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?
Thanks
Eugene