Note that the best_k stuff is no longer needed for MPIR 2.6.0 and
above, as this is handled automatically and internally. And the
fft_next_size function, which has now essentially been replaced by
fft_adjust_limbs, does not need to know k.

I suspect you only need i = fft_next_size(i), rather than i =
fft_next_size(i + 1), but one of the GMP-ECM developers can probably
confirm this (if it doesn't just fail with i = fft_next_size(i)).

Bill.

On 15 October 2012 14:31, Brian Gladman <b...@gladman.plus.com> wrote:
> -----Original Message----- From: Bill Hart
> Sent: Monday, October 15, 2012 2:19 PM
>
> To: mpir-devel@googlegroups.com
> Subject: Re: [mpir-devel] MPIR 2.6.0-alpha2 released
>
> According to the documentation for mpn_mul_fft:
>
> /* put in {op, pl} the product of {n, nl} * {m, ml} mod (B^pl+1)
>   where B = 2^GMP_NUMB_BITS. */
>
> This is essentially the function of the new:
>
> int
> mpn_mulmod_Bexpp1_fft (mp_ptr op, mp_size_t pl,
>     mp_srcptr n, mp_size_t nl,
>     mp_srcptr m, mp_size_t ml)
>
> An example of its use is lines 87-89 of mpn/generic/inv_div_qr_n.c in MPIR.
>
> I couldn't imagine this taking more than 10 mins of someone's time to
> fix, given this information.
>
> ========================
>
> You might be right but it has to work for both GMP and MPIR and it is not
> obvious to me where to put in the GMP/MPIR branches in the three GMP-ECM
> files affected:
>
> gmp-ecm\ks-multiply.c(27):    #define FFT_WRAP /* always defined since
> mpn_mul_fft is included */
> gmp-ecm\ks-multiply.c(520):   k = mpn_fft_best_k ((m + n + 1) * s, 0);
> gmp-ecm\ks-multiply.c(521):   bn = mpn_fft_next_size ((m + n + 1) * s, k);
> gmp-ecm\ks-multiply.c(523):   k_old = mpn_fft_best_k ((m + n + 1) * s_old,
> 0);
> gmp-ecm\ks-multiply.c(528):   bn_old = mpn_fft_next_size ((m + n + 1) *
> s_old, k_old);
> gmp-ecm\ks-multiply.c(540):   mpn_mul_fft (bp, bn, ap, an, cp, cn, k);
> gmp-ecm\ks-multiply.c(605):   fft_k = mpn_fft_best_k (m0 * s, 0);
> gmp-ecm\ks-multiply.c(606):   i = mpn_fft_next_size (m0 * s, fft_k);
> gmp-ecm\ks-multiply.c(608):   i = mpn_fft_next_size (i + 1, fft_k);
> gmp-ecm\ks-multiply.c(670):   fft_k = mpn_fft_best_k (m0 * s, 0);
> gmp-ecm\ks-multiply.c(671):   i = mpn_fft_next_size (m0 * s, fft_k);
> gmp-ecm\ks-multiply.c(675):   i = mpn_fft_next_size (i + 1, fft_k);
> gmp-ecm\ks-multiply.c(687):   mpn_mul_fft (t2_ptr, i, t0_ptr, size_t0,
> t1_ptr, size_t1, fft_k);
>
> gmp-ecm\mpmod.c(1456):        k = mpn_fft_best_k (n, S1 == S2);
> gmp-ecm\mpmod.c(1457):        ASSERT(mpn_fft_next_size (n, k) == n);
> gmp-ecm\mpmod.c(1475):        /* mpn_mul_fft() computes the product modulo
> B^n + 1, where
> gmp-ecm\mpmod.c(1479):        R + cy * B^n, where cy is the value returned
> by mpn_mul_fft(). */
> gmp-ecm\mpmod.c(1480):        PTR(R)[n] = mpn_mul_fft (PTR(R), n, s1p,
> ABS(s1s), s2p, ABS(s2s), k);
> gmp-ecm\mpmod.c(1665):        k = mpn_fft_best_k (n, S1 == S2);
> gmp-ecm\mpmod.c(1666):        ASSERT(mpn_fft_next_size (n, k) == n);
> gmp-ecm\mpmod.c(1684):        /* mpn_mul_fft() computes the product modulo
> B^n + 1, where
> gmp-ecm\mpmod.c(1688):        R + cy * B^n, where cy is the value returned
> by mpn_mul_fft(). */
> gmp-ecm\mpmod.c(1689):        PTR(R)[n] = mpn_mul_fft (PTR(R), n, s1p,
> ABS(s1s), s2p, ABS(s2s), k);
>
> gmp-ecm\schoen_strass.c(178): k = mpn_fft_best_k (n2, S1 == S2);
> gmp-ecm\schoen_strass.c(179): mpn_mul_fft (PTR(gt), n2, PTR(S1), ABSIZ(S1),
> PTR(S2), ABSIZ(S2), k);
>
> I hoped that I might be able to do this but I now doubt this :-(
>
>
>      Brian
>
> --
> You received this message because you are subscribed to the Google Groups
> "mpir-devel" group.
> To post to this group, send email to mpir-devel@googlegroups.com.
> To unsubscribe from this group, send email to
> mpir-devel+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mpir-devel?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to