Extending the mpn interface

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Mon Feb 18 12:00:59 CET 2013


Il Lun, 18 Febbraio 2013 10:10 am, Niels Möller ha scritto:
> My gut feeling is no. If you want to compute a result into an mpn
> variable, and the "best" way to do that is by calling some mpz function,
> then that would typically mean that an mpn-level function is missing.
> Do you have any example use cases, inside or outside of GMP itself?

It might be useful to quickly write complex mpn functions...

E.g: It is not easy to write a generic Toom-N+1/2 taking N as a parameter,
because you have to handle the possible change of size and sign for an
array of intermediate values, moreover you need lots of submul that are
not submul_1 (and can change the sign of the result).

I used a read-only my_mpz_init (inherited from Toom-4 code by Paul
Zimmermann), to write my initial Toom-5,6,7 implementations. I should try
with a self-made read-write mpz_staticinit for higher degree, so that I'll
be able to tell if it can be useful or not :-)

We can start with the read-only version...



More information about the gmp-devel mailing list