Karim BELABAS on Wed, 24 May 2000 17:57:55 +0200 (MET DST)


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

Re: reading integer data from file


[Renu:]
> this is a newbie question. am using PARI in library mode. i want to assign
> a vector with integer values stored in a file (all the values are greater
> than 2^64). can someone tell me how to do it. the data file was created
> using gp by writing a vector to the file, so the integers are seperated by
> a comma and blank.

Easy way: use lisGEN()
[ reads a PARI object from a FILE* up to the first '\n'. Of course you
can call it repeatedly. ]

General and most flexible solution:
1) read everything into a C character string
2) apply flisexpr() to the string.

  Karim.
__
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://www.parigp-home.de/