

How to use the pari library version of Tim Dokshitser's file computel.gp,
file computel5.gp.c

1) Use the compile command on the first line (you can of course change
the name from computel5 to anything you like, but you will need to do a
global replacement in the file since the name is used several times).
This will in particular create a shared library computel5.gp.so.
(This can also be done by running gp2c-run computel5.gp.c, do not forget
to type the .c at the end).
All functions become available as pari functions, and if under GP can be
installed with all the GP;install commands (again gp2c-run does all this).

2) To use the package you MUST begin by the function initall() which
takes a vector as argument. This vector v MUST contain
v[1]=conductor, v[2]=gammaV as in Tim's files, then optionally, IN THIS ORDER,
the weight, sgn (root number), Lpoles, Lresidues, MaxImaginaryPart,
MaxAsympCoeffs, mycoefgrow. These are all explained in Tim's scripts,
EXCEPT for mycoefgrow (see (8) below for this).

3) You can also set or obtain these global arguments by the corresponding
functions setconductor(x), getconductor(), etc... (getmycoefgrow does not
exist, useless). You can communicate with the program about these variables
ONLY by using these functions. Writing conductor = 1 is useless: you must
write setconductor(1). Writing print(conductor) is similarly useless, you
must type print(getconductor()).

4) Define the function giving the coefficients as a "closure" (see all the
examples). For instance:
aaa = (k->ellak(ell,k)), or aaa = (n->avec[n%p+1]) (example chgen), etc...
If needed, as in chgen, define also the function defining the coefficients
of the dual motive, again as a closure.
Three differences with Tim: he passes the function as a string. Here must be
a closure. Second, if dual motive necessary, must define a new closure,
Tim only puts a "conj" in front. Third, Tim uses often the letter a() for
the coeffs. Much too dangerous, I use for instance aaa (and aaac for 
conjugate).

5) Call the function initLdata(...) parameters explained in Tim. EG,
initLdata(aaa), initLdata(aaa,1), initLdata(aaa,,aaac).

6) You can then use all of Tim's functions. Example: in chgen, he computes
the sgn (-sgneq[2]/sgneq[1]), so need to use the function setsgn. Below,
he wants the parity of the character, so need getgammaV()[1] instead
of gammaV[1].
In nfc, one doesn't know the needed number of coefs. Thus, we initialize
initall() with what is known, and then calls cflength() (which of course
does not need all the data computed by initLdata). After that can define
aaa and call initLdata(aaa) and do the work.

7) I renamed the 12 examples of Tim since they use a slightly different
syntax. Thus ex-bsw becomes exbswc.gp, etc... The file testall can be
read from a gp-run session, everything works for me.

8) Explanation of mycoefgrow: Tim uses a guess for the coefficient growth,
and says that the function "coefgrow" which does that guess can be changed
by the user. With this C program, in order to change that function the user
must type setcoefgrow(grow), where again grow is a "closure", i.e. a 1-variable
function giving an estimate for the coefficient size. WARNING: this function
must return an integer. EG in deltac, the function grow is
(n->ceil(2*n^(11/2))), with the ceil function. Must be called after
initall() but before initLdata.

9) Final comments: need a pari version which understand closures (check
the existence of the function closure_callgen1() in the source). 
The main trick in converting Tim's scripts is to use gclone(). Not elegant
and uses memory, but works. Program not at all optimized, but slightly
cleaned up.
