Efficient implementation of polynomial multiplication

Kevin Ryde user42 at zip.com.au
Sun Mar 7 06:53:51 CET 2004

Décio Luiz Gazzoni Filho <decio at decpp.net> writes:
> I'm thinking either something that manipulates the mpz_t->_mp_d array 
> directly,

Don't do that if you want to be compatible with future releases.

> or something using mpz_import/mpz_export...

If the shifts aren't doing what you want then this would be the go.

You might want to break out the profiler to check time is going where
you think it is.

>   X->_mp_size = deg*limbs+j;

You may have to realloc X to ensure there's enough room at _mp_d.  And
you definitely must ensure the high limb is non-zero.  See "Internals"
in the manual if you really want to do this sort of thing.

More information about the gmp-discuss mailing list