| Karim Belabas on Sun, 14 Nov 2004 15:37:06 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: Using gp as engine (server) |
* Paul Brants [2004-11-09 21:59]:
> I just downloaded the pariguide program. I'm planning to write a program that like pariguide uses gp as engine (server).
>
>
> 1) How do I call gp from my program to do calculations?
> 2) How do I get the results of the calculations back into my calling program?
> I think that sending a .gp file to gp somehow is an option, but I do not know how to do it.
> Can someone help me out?
I quickly sketched one possibility in
http://pari.math.u-bordeaux.fr/archives/pari-dev-0304/msg00071.html
An alternative is not to use GP at all, but directly libpari, with
constructions like
GEN x = flisexpr("input expression, GP syntax");
char *s = GENtostr(x); /* convert output to character string */
... use s ...
free(s);
Cheers,
Karim.
--
Karim Belabas Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425 Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France) http://pari.math.u-bordeaux.fr/ [PARI/GP]