Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / fft / gsl_fft_complex.h
1 /* fft/gsl_fft_complex.h
2  * 
3  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
4  * 
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.
9  * 
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.
14  * 
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.
18  */
19
20 #ifndef __GSL_FFT_COMPLEX_H__
21 #define __GSL_FFT_COMPLEX_H__
22
23 #include <stddef.h>
24
25 #include <gsl/gsl_math.h>
26 #include <gsl/gsl_complex.h>
27 #include <gsl/gsl_fft.h>
28
29 #undef __BEGIN_DECLS
30 #undef __END_DECLS
31 #ifdef __cplusplus
32 # define __BEGIN_DECLS extern "C" {
33 # define __END_DECLS }
34 #else
35 # define __BEGIN_DECLS /* empty */
36 # define __END_DECLS /* empty */
37 #endif
38
39 __BEGIN_DECLS
40
41 /*  Power of 2 routines  */
42
43
44 int gsl_fft_complex_radix2_forward (gsl_complex_packed_array data,
45                                     const size_t stride,
46                                     const size_t n);
47
48 int gsl_fft_complex_radix2_backward (gsl_complex_packed_array data,
49                                      const size_t stride,
50                                      const size_t n);
51
52 int gsl_fft_complex_radix2_inverse (gsl_complex_packed_array data,
53                                     const size_t stride,
54                                     const size_t n);
55
56 int gsl_fft_complex_radix2_transform (gsl_complex_packed_array data,
57                                       const size_t stride,
58                                       const size_t n,
59                                       const gsl_fft_direction sign);
60
61 int gsl_fft_complex_radix2_dif_forward (gsl_complex_packed_array data,
62                                         const size_t stride,
63                                         const size_t n);
64
65 int gsl_fft_complex_radix2_dif_backward (gsl_complex_packed_array data,
66                                          const size_t stride,
67                                          const size_t n);
68
69 int gsl_fft_complex_radix2_dif_inverse (gsl_complex_packed_array data,
70                                         const size_t stride,
71                                         const size_t n);
72
73 int gsl_fft_complex_radix2_dif_transform (gsl_complex_packed_array data,
74                                           const size_t stride,
75                                           const size_t n,
76                                           const gsl_fft_direction sign);
77
78 /*  Mixed Radix general-N routines  */
79
80 typedef struct
81   {
82     size_t n;
83     size_t nf;
84     size_t factor[64];
85     gsl_complex *twiddle[64];
86     gsl_complex *trig;
87   }
88 gsl_fft_complex_wavetable;
89
90 typedef struct
91 {
92   size_t n;
93   double *scratch;
94 }
95 gsl_fft_complex_workspace;
96
97
98 gsl_fft_complex_wavetable *gsl_fft_complex_wavetable_alloc (size_t n);
99
100 void gsl_fft_complex_wavetable_free (gsl_fft_complex_wavetable * wavetable);
101
102 gsl_fft_complex_workspace *gsl_fft_complex_workspace_alloc (size_t n);
103
104 void gsl_fft_complex_workspace_free (gsl_fft_complex_workspace * workspace);
105
106 int gsl_fft_complex_memcpy (gsl_fft_complex_wavetable * dest,
107                             gsl_fft_complex_wavetable * src);
108
109
110 int gsl_fft_complex_forward (gsl_complex_packed_array data,
111                              const size_t stride,
112                              const size_t n,
113                              const gsl_fft_complex_wavetable * wavetable,
114                              gsl_fft_complex_workspace * work);
115
116 int gsl_fft_complex_backward (gsl_complex_packed_array data,
117                               const size_t stride,
118                               const size_t n,
119                               const gsl_fft_complex_wavetable * wavetable,
120                               gsl_fft_complex_workspace * work);
121
122 int gsl_fft_complex_inverse (gsl_complex_packed_array data,
123                              const size_t stride,
124                              const size_t n,
125                              const gsl_fft_complex_wavetable * wavetable,
126                              gsl_fft_complex_workspace * work);
127
128 int gsl_fft_complex_transform (gsl_complex_packed_array data,
129                                const size_t stride, const size_t n,
130                                const gsl_fft_complex_wavetable * wavetable,
131                                gsl_fft_complex_workspace * work,
132                                const gsl_fft_direction sign);
133
134 __END_DECLS
135
136 #endif /* __GSL_FFT_COMPLEX_H__ */