gmp binary file

Marc Glisse marc.glisse at normalesup.org
Sun Oct 11 20:58:13 CEST 2009


On Sun, 11 Oct 2009, Christ Schlacta wrote:

> is it possible to store mpzclass in a binary file for faster writing and 
> loading, or is that simply not an option?  I'm working with a somewhat 
> gmp-io-bound app, and faster read/write would rock.

Do you mean faster than the formatted I/O? mpz_class is a simple wrapper 
to the C type mpz_t, so you can use the C I/O functions on 
number.get_mpz_t(). See for instance:
http://gmplib.org/manual/Integer-Import-and-Export.html
http://gmplib.org/manual/I_002fO-of-Integers.html

-- 
Marc Glisse


More information about the gmp-discuss mailing list