recursive to iterative mpn/mul_fft?

Torbjorn Granlund tg at gmplib.org
Fri Aug 12 16:50:55 CEST 2011


Sven Bettscheider <Sven.Bettscheider at gmx.de> writes:

  In function mpn_fft_fft(...)
  
  if (K == 2){...}
      else
      {
        int j;
        int *lk = *ll;
        mpn_fft_fft (Ap,     K >> 1, ll-1, 2 * omega, n, inc * 2, tp);
        mpn_fft_fft (Ap+inc, K >> 1, ll-1, 2 * omega, n, inc * 2, tp);
        /* A[2*j*inc]   <- A[2*j*inc] + omega^l[k][2*j*inc] A[(2j+1)inc]
            A[(2j+1)inc] <- A[2*j*inc] + omega^l[k][(2j+1)inc] A[(2j+1)inc] */
  
      }
  
  Is it possible to implement the red lines with using a loop (while, for)?
  
Sure.  Note that the depth of these calls is logarithmic in the operand
size.

-- 
Torbjörn


More information about the gmp-discuss mailing list