#include #include /* struct timeval */ #include /* struct rusage */ /* time declarations */ struct rusage start_struct, stop_struct; float print_times(struct rusage, struct rusage, int); void print_vector(double *, int, int); void finish(struct rusage, struct rusage, int, int, int); void test_original (int, int); void test_ct_spec(void (*)(), int, int); void test_rt_spec(int, int); #define ORIGINAL 0 #define CTSPEC 1 #define RTGEN 2 #define RTSPEC 3 extern void fft(int, double *, double *); extern void fft_16(); extern void fft_32(); extern void fft_64(); extern void fft_128(); /* ** FFT tester ** Loads random numbers into complex array, ffts it, and shows result. ** Beats me what the output should be; but any two different ffts ** should return the same result. ** ** % tester output 10000 */ #define MAX 128 #define REAL double REAL init_real[140001], real[140001]; REAL init_imag[140001], imag[140001]; void (*spec)(REAL *, REAL *); main(argc,argv) int argc; char **argv; { int i,j, repetitions; FILE *o; char *output; if (argc < 2) repetitions = 1; else repetitions = atoi(argv[1]); printf ("fft_duhamel, %d repetitions\n\n", repetitions); for (i=0;i