wrap-around interface

Zimmermann Paul Paul.Zimmermann at loria.fr
Thu Oct 18 11:06:22 CEST 2012


       Niels,

> From: nisse at lysator.liu.se (Niels Möller)
> Date: Thu, 18 Oct 2012 10:43:34 +0200
> 
> Zimmermann Paul <Paul.Zimmermann at loria.fr> writes:
> 
> > void mpn_mulmod_bnm1 (mp_ptr rp, mp_size_t rn, mp_srcptr ap, mp_size_t an,
> >                       mp_srcptr, bp, mp_size_t bn, mp_ptr tp)
> > Multiplies {ap, an} by {bp, bn} mod B^rn-1 where B=2^mp_bits_per_limb,
> > and stores the result into {rp, rn}. The scratch space tp is either NULL,
> > in which case the function allocates itself the needed memory, or it should
> > contain at least 2*rn+4 limbs (or the number of needed limbs should be
> > documented).
> 
> To find out the needed scratch space, you should use
> mpn_mulmod_bnm1_itch. Scratch need is going to change if/when the fft
> code (or general multiplication) is converted to an itch/scratch
> interface.
> 
> If we make this interface public, should we advertise itch/scratch, or
> should we keep that detail internal, and require applications to always
> pass tp == NULL?
> 
> Regards,
> /Niels

good remark. I propose applications always pass tp == NULL.
Then I suggest removing the tp argument to make the user interface simpler.

Paul


More information about the gmp-devel mailing list