3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <gsl/gsl_complex.h>
29 #include <gsl/gsl_errno.h>
30 #include <gsl/gsl_dft_complex.h>
31 #include <gsl/gsl_fft_complex.h>
32 #include <gsl/gsl_fft_complex_float.h>
33 #include <gsl/gsl_fft_real.h>
34 #include <gsl/gsl_fft_real_float.h>
35 #include <gsl/gsl_fft_halfcomplex.h>
36 #include <gsl/gsl_fft_halfcomplex_float.h>
37 #include <gsl/gsl_ieee_utils.h>
38 #include <gsl/gsl_test.h>
40 void my_error_handler (const char *reason, const char *file,
43 #include "complex_internal.h"
46 Exercise the fft routines for length n. By default n runs from 1 to 100.
47 The exit status indicates success or failure. */
50 #include "templates_on.h"
51 #include "compare_source.c"
52 #include "bitreverse.c"
53 #include "test_complex_source.c"
54 #include "test_real_source.c"
55 #include "test_trap_source.c"
56 #include "templates_off.h"
60 #include "templates_on.h"
61 #include "compare_source.c"
62 #include "bitreverse.c"
63 #include "test_complex_source.c"
64 #include "test_real_source.c"
65 #include "test_trap_source.c"
66 #include "templates_off.h"
70 main (int argc, char *argv[])
73 size_t start = 1, end = 99;
77 gsl_ieee_env_setup ();
80 n = strtol (argv[1], NULL, 0);
89 for (i = 1 ; i <= end ; i *= 2)
93 for (stride = 1 ; stride < 4 ; stride++)
95 test_complex_bitreverse_order (stride, i) ;
96 test_complex_radix2 (stride, i) ;
97 test_real_bitreverse_order (stride, i) ;
98 test_real_radix2 (stride, i) ;
103 for (i = start ; i <= end ; i++)
105 for (stride = 1 ; stride < 4 ; stride++)
107 test_complex_func (stride, i) ;
108 test_complex_float_func (stride, i) ;
109 test_real_func (stride, i) ;
110 test_real_float_func (stride, i) ;
114 gsl_set_error_handler (&my_error_handler);
118 exit (gsl_test_summary ());
123 my_error_handler (const char *reason, const char *file, int line, int err)
125 if (0) printf ("(caught [%s:%d: %s (%d)])\n", file, line, reason, err) ;