Mike Rosing on Mon, 23 Feb 2015 19:39:38 +0100


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

Using libpari


Hello,

I am trying to use libpari as a stand alone C program rather than creating useful functions for gp. I can do things easily with gp (well, not so easy the first time!) but when I try to do similar things in C I get a lot of errors.

What I would like to do is create GF(2^n) elements in "increasing" order:
1
t
t + 1 t^2
t^2 + 1
t^2 + t
t^2 + t + 1
etc..

I start my program, and things are fine:

#include <pari/pari.h>

int main()
{
  GEN y, E, f, z, a1, a2;

  pari_init(2*1024*1024, 5*1024*512);
  z = ffinit(gen_2, 10, -1);
  y = ffgen(z, -1);
  pari_printf("%Ps %ld\n", type0(y), lg(y));

----------------------

I can give a2 a constant value like gen_1, but I have no idea how to give it a value of y, let alone different t_FFELT values. I have read the users guide and the libpari manual, but the things I've tried which are similar to t_REAL or t_INT fail miserably.

I'm not really worried about efficiency, I'd just like to make it work.
Thanks for any help!
Mike