version 1.2, 2000/08/21 08:31:33 |
version 1.6, 2018/03/29 01:32:53 |
|
|
* shall be made on your publication or presentation in any form of the |
* shall be made on your publication or presentation in any form of the |
* results obtained by use of the SOFTWARE. |
* results obtained by use of the SOFTWARE. |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification |
* e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification |
* for such modification or the source code of the modified part of the |
* for such modification or the source code of the modified part of the |
* SOFTWARE. |
* SOFTWARE. |
* |
* |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/fft/fft_primes.c,v 1.1.1.1 1999/12/03 07:39:08 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/fft/fft_primes.c,v 1.5 2003/02/14 22:29:10 ohara Exp $ |
*/ |
*/ |
#include "dft.h" |
#include "dft.h" |
|
|
struct PrimesS Primes[NPrimes+1] = { |
struct PrimesS Primes[NPrimes+1] = { |
#if !USE_FLOAT |
#if !defined(USE_FLOAT) |
{536813569,234750831,29,13}, |
{536813569,234750831,29,13}, |
{536752129,402492685,29,12}, |
{536752129,402492685,29,12}, |
{536743937,186329165,29,12}, |
{536743937,186329165,29,12}, |
Line 13754 static int blen_prod_fftprime[MAX_D+1] = |
|
Line 13754 static int blen_prod_fftprime[MAX_D+1] = |
|
0 if not. |
0 if not. |
*/ |
*/ |
|
|
int fft_available(d1,n1,d2,n2) |
int int_bits(int); |
int d1,n1,d2,n2; |
|
|
int fft_available(int d1,int n1,int d2,int n2) |
{ |
{ |
int dmin,bound,dlen; |
int dmin,bound,dlen; |
|
|
dmin = d1>d2?d2:d1; |
dmin = d1>d2?d2:d1; |
bound = n1+n2+int_bits(dmin)+1; |
bound = n1+n2+int_bits(dmin)+1; |
dlen = int_bits(d1+d2); |
dlen = int_bits(d1+d2); |
if ( dlen > MAX_D ) |
if ( dlen > MAX_D ) |
return 0; |
return 0; |
else if ( blen_prod_fftprime[dlen] <= bound ) |
else if ( blen_prod_fftprime[dlen] <= bound ) |
return 0; |
return 0; |
else |
else |
return 1; |
return 1; |
} |
} |
|
|
void get_fft_prime(int index,int *p,int *d) |
void get_fft_prime(int index,int *p,int *d) |
{ |
{ |
if ( index < 0 || index >= NPrimes ) { |
if ( index < 0 || index >= NPrimes ) { |
*p = 0; *d = 0; |
*p = 0; *d = 0; |
} else { |
} else { |
*p = Primes[index].prime; *d = Primes[index].d; |
*p = Primes[index].prime; *d = Primes[index].d; |
} |
} |
} |
} |