annotate libs/aubioFullOSXUni/include/fft/fftw3.h @ 2:fa2af670b5c5 tip

SoundFileLoader might have moved
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 06 Jan 2012 00:23:26 +0000
parents bcb0d40158f4
children
rev   line source
andrew@0 1 /*
andrew@0 2 * Copyright (c) 2003, 2006 Matteo Frigo
andrew@0 3 * Copyright (c) 2003, 2006 Massachusetts Institute of Technology
andrew@0 4 *
andrew@0 5 * The following statement of license applies *only* to this header file,
andrew@0 6 * and *not* to the other files distributed with FFTW or derived therefrom:
andrew@0 7 *
andrew@0 8 * Redistribution and use in source and binary forms, with or without
andrew@0 9 * modification, are permitted provided that the following conditions
andrew@0 10 * are met:
andrew@0 11 *
andrew@0 12 * 1. Redistributions of source code must retain the above copyright
andrew@0 13 * notice, this list of conditions and the following disclaimer.
andrew@0 14 *
andrew@0 15 * 2. Redistributions in binary form must reproduce the above copyright
andrew@0 16 * notice, this list of conditions and the following disclaimer in the
andrew@0 17 * documentation and/or other materials provided with the distribution.
andrew@0 18 *
andrew@0 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
andrew@0 20 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
andrew@0 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
andrew@0 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
andrew@0 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
andrew@0 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
andrew@0 25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
andrew@0 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
andrew@0 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
andrew@0 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
andrew@0 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
andrew@0 30 */
andrew@0 31
andrew@0 32 /***************************** NOTE TO USERS *********************************
andrew@0 33 *
andrew@0 34 * THIS IS A HEADER FILE, NOT A MANUAL
andrew@0 35 *
andrew@0 36 * If you want to know how to use FFTW, please read the manual,
andrew@0 37 * online at http://www.fftw.org/doc/ and also included with FFTW.
andrew@0 38 * For a quick start, see the manual's tutorial section.
andrew@0 39 *
andrew@0 40 * (Reading header files to learn how to use a library is a habit
andrew@0 41 * stemming from code lacking a proper manual. Arguably, it's a
andrew@0 42 * *bad* habit in most cases, because header files can contain
andrew@0 43 * interfaces that are not part of the public, stable API.)
andrew@0 44 *
andrew@0 45 ****************************************************************************/
andrew@0 46
andrew@0 47 /* header file for fftw3 */
andrew@0 48 /* (The following is the CVS ID for this file, *not* the version
andrew@0 49 number of FFTW:) */
andrew@0 50 /* $Id: fftw3.h,v 1.90 2006-01-17 04:03:33 stevenj Exp $ */
andrew@0 51
andrew@0 52 #ifndef FFTW3_H
andrew@0 53 #define FFTW3_H
andrew@0 54
andrew@0 55 #include <stdio.h>
andrew@0 56
andrew@0 57 #ifdef __cplusplus
andrew@0 58 extern "C"
andrew@0 59 {
andrew@0 60 #endif /* __cplusplus */
andrew@0 61
andrew@0 62 /* If <complex.h> is included, use the C99 complex type. Otherwise
andrew@0 63 define a type bit-compatible with C99 complex */
andrew@0 64 #if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I)
andrew@0 65 # define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C
andrew@0 66 #else
andrew@0 67 # define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2]
andrew@0 68 #endif
andrew@0 69
andrew@0 70 #define FFTW_CONCAT(prefix, name) prefix ## name
andrew@0 71 #define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name)
andrew@0 72 #define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name)
andrew@0 73 #define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name)
andrew@0 74
andrew@0 75 /* IMPORTANT: for Windows compilers, you should add a line
andrew@0 76 #define FFTW_DLL
andrew@0 77 here and in kernel/ifftw.h if you are compiling/using FFTW as a
andrew@0 78 DLL, in order to do the proper importing/exporting, or
andrew@0 79 alternatively compile with -DFFTW_DLL or the equivalent
andrew@0 80 command-line flag. This is not necessary under MinGW/Cygwin, where
andrew@0 81 libtool does the imports/exports automatically. */
andrew@0 82 #if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__))
andrew@0 83 /* annoying Windows syntax for shared-library declarations */
andrew@0 84 # if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */
andrew@0 85 # define FFTW_EXTERN extern __declspec(dllexport)
andrew@0 86 # else /* user is calling FFTW; import symbol */
andrew@0 87 # define FFTW_EXTERN extern __declspec(dllimport)
andrew@0 88 # endif
andrew@0 89 #else
andrew@0 90 # define FFTW_EXTERN extern
andrew@0 91 #endif
andrew@0 92
andrew@0 93 enum fftw_r2r_kind_do_not_use_me {
andrew@0 94 FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2,
andrew@0 95 FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6,
andrew@0 96 FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10
andrew@0 97 };
andrew@0 98
andrew@0 99 struct fftw_iodim_do_not_use_me {
andrew@0 100 int n; /* dimension size */
andrew@0 101 int is; /* input stride */
andrew@0 102 int os; /* output stride */
andrew@0 103 };
andrew@0 104
andrew@0 105 /*
andrew@0 106 huge second-order macro that defines prototypes for all API
andrew@0 107 functions. We expand this macro for each supported precision
andrew@0 108
andrew@0 109 X: name-mangling macro
andrew@0 110 R: real data type
andrew@0 111 C: complex data type
andrew@0 112 */
andrew@0 113
andrew@0 114 #define FFTW_DEFINE_API(X, R, C) \
andrew@0 115 \
andrew@0 116 FFTW_DEFINE_COMPLEX(R, C); \
andrew@0 117 \
andrew@0 118 typedef struct X(plan_s) *X(plan); \
andrew@0 119 \
andrew@0 120 typedef struct fftw_iodim_do_not_use_me X(iodim); \
andrew@0 121 \
andrew@0 122 typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \
andrew@0 123 \
andrew@0 124 FFTW_EXTERN void X(execute)(const X(plan) p); \
andrew@0 125 \
andrew@0 126 FFTW_EXTERN X(plan) X(plan_dft)(int rank, const int *n, \
andrew@0 127 C *in, C *out, int sign, unsigned flags); \
andrew@0 128 \
andrew@0 129 FFTW_EXTERN X(plan) X(plan_dft_1d)(int n, C *in, C *out, int sign, \
andrew@0 130 unsigned flags); \
andrew@0 131 FFTW_EXTERN X(plan) X(plan_dft_2d)(int nx, int ny, \
andrew@0 132 C *in, C *out, int sign, unsigned flags); \
andrew@0 133 FFTW_EXTERN X(plan) X(plan_dft_3d)(int nx, int ny, int nz, \
andrew@0 134 C *in, C *out, int sign, unsigned flags); \
andrew@0 135 \
andrew@0 136 FFTW_EXTERN X(plan) X(plan_many_dft)(int rank, const int *n, \
andrew@0 137 int howmany, \
andrew@0 138 C *in, const int *inembed, \
andrew@0 139 int istride, int idist, \
andrew@0 140 C *out, const int *onembed, \
andrew@0 141 int ostride, int odist, \
andrew@0 142 int sign, unsigned flags); \
andrew@0 143 \
andrew@0 144 FFTW_EXTERN X(plan) X(plan_guru_dft)(int rank, const X(iodim) *dims, \
andrew@0 145 int howmany_rank, \
andrew@0 146 const X(iodim) *howmany_dims, \
andrew@0 147 C *in, C *out, \
andrew@0 148 int sign, unsigned flags); \
andrew@0 149 FFTW_EXTERN X(plan) X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \
andrew@0 150 int howmany_rank, \
andrew@0 151 const X(iodim) *howmany_dims, \
andrew@0 152 R *ri, R *ii, R *ro, R *io, \
andrew@0 153 unsigned flags); \
andrew@0 154 \
andrew@0 155 FFTW_EXTERN void X(execute_dft)(const X(plan) p, C *in, C *out); \
andrew@0 156 FFTW_EXTERN void X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \
andrew@0 157 R *ro, R *io); \
andrew@0 158 \
andrew@0 159 FFTW_EXTERN X(plan) X(plan_many_dft_r2c)(int rank, const int *n, \
andrew@0 160 int howmany, \
andrew@0 161 R *in, const int *inembed, \
andrew@0 162 int istride, int idist, \
andrew@0 163 C *out, const int *onembed, \
andrew@0 164 int ostride, int odist, \
andrew@0 165 unsigned flags); \
andrew@0 166 \
andrew@0 167 FFTW_EXTERN X(plan) X(plan_dft_r2c)(int rank, const int *n, \
andrew@0 168 R *in, C *out, unsigned flags); \
andrew@0 169 \
andrew@0 170 FFTW_EXTERN X(plan) X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \
andrew@0 171 FFTW_EXTERN X(plan) X(plan_dft_r2c_2d)(int nx, int ny, \
andrew@0 172 R *in, C *out, unsigned flags); \
andrew@0 173 FFTW_EXTERN X(plan) X(plan_dft_r2c_3d)(int nx, int ny, \
andrew@0 174 int nz, \
andrew@0 175 R *in, C *out, unsigned flags); \
andrew@0 176 \
andrew@0 177 \
andrew@0 178 FFTW_EXTERN X(plan) X(plan_many_dft_c2r)(int rank, const int *n, \
andrew@0 179 int howmany, \
andrew@0 180 C *in, const int *inembed, \
andrew@0 181 int istride, int idist, \
andrew@0 182 R *out, const int *onembed, \
andrew@0 183 int ostride, int odist, \
andrew@0 184 unsigned flags); \
andrew@0 185 \
andrew@0 186 FFTW_EXTERN X(plan) X(plan_dft_c2r)(int rank, const int *n, \
andrew@0 187 C *in, R *out, unsigned flags); \
andrew@0 188 \
andrew@0 189 FFTW_EXTERN X(plan) X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \
andrew@0 190 FFTW_EXTERN X(plan) X(plan_dft_c2r_2d)(int nx, int ny, \
andrew@0 191 C *in, R *out, unsigned flags); \
andrew@0 192 FFTW_EXTERN X(plan) X(plan_dft_c2r_3d)(int nx, int ny, \
andrew@0 193 int nz, \
andrew@0 194 C *in, R *out, unsigned flags); \
andrew@0 195 \
andrew@0 196 FFTW_EXTERN X(plan) X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \
andrew@0 197 int howmany_rank, \
andrew@0 198 const X(iodim) *howmany_dims, \
andrew@0 199 R *in, C *out, \
andrew@0 200 unsigned flags); \
andrew@0 201 FFTW_EXTERN X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \
andrew@0 202 int howmany_rank, \
andrew@0 203 const X(iodim) *howmany_dims, \
andrew@0 204 C *in, R *out, \
andrew@0 205 unsigned flags); \
andrew@0 206 \
andrew@0 207 FFTW_EXTERN X(plan) X(plan_guru_split_dft_r2c)( \
andrew@0 208 int rank, const X(iodim) *dims, \
andrew@0 209 int howmany_rank, \
andrew@0 210 const X(iodim) *howmany_dims, \
andrew@0 211 R *in, R *ro, R *io, \
andrew@0 212 unsigned flags); \
andrew@0 213 FFTW_EXTERN X(plan) X(plan_guru_split_dft_c2r)( \
andrew@0 214 int rank, const X(iodim) *dims, \
andrew@0 215 int howmany_rank, \
andrew@0 216 const X(iodim) *howmany_dims, \
andrew@0 217 R *ri, R *ii, R *out, \
andrew@0 218 unsigned flags); \
andrew@0 219 \
andrew@0 220 FFTW_EXTERN void X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \
andrew@0 221 FFTW_EXTERN void X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \
andrew@0 222 \
andrew@0 223 FFTW_EXTERN void X(execute_split_dft_r2c)(const X(plan) p, \
andrew@0 224 R *in, R *ro, R *io); \
andrew@0 225 FFTW_EXTERN void X(execute_split_dft_c2r)(const X(plan) p, \
andrew@0 226 R *ri, R *ii, R *out); \
andrew@0 227 \
andrew@0 228 FFTW_EXTERN X(plan) X(plan_many_r2r)(int rank, const int *n, \
andrew@0 229 int howmany, \
andrew@0 230 R *in, const int *inembed, \
andrew@0 231 int istride, int idist, \
andrew@0 232 R *out, const int *onembed, \
andrew@0 233 int ostride, int odist, \
andrew@0 234 const X(r2r_kind) *kind, unsigned flags); \
andrew@0 235 \
andrew@0 236 FFTW_EXTERN X(plan) X(plan_r2r)(int rank, const int *n, R *in, R *out, \
andrew@0 237 const X(r2r_kind) *kind, unsigned flags); \
andrew@0 238 \
andrew@0 239 FFTW_EXTERN X(plan) X(plan_r2r_1d)(int n, R *in, R *out, \
andrew@0 240 X(r2r_kind) kind, unsigned flags); \
andrew@0 241 FFTW_EXTERN X(plan) X(plan_r2r_2d)(int nx, int ny, R *in, R *out, \
andrew@0 242 X(r2r_kind) kindx, X(r2r_kind) kindy, \
andrew@0 243 unsigned flags); \
andrew@0 244 FFTW_EXTERN X(plan) X(plan_r2r_3d)(int nx, int ny, int nz, \
andrew@0 245 R *in, R *out, X(r2r_kind) kindx, \
andrew@0 246 X(r2r_kind) kindy, X(r2r_kind) kindz, \
andrew@0 247 unsigned flags); \
andrew@0 248 \
andrew@0 249 FFTW_EXTERN X(plan) X(plan_guru_r2r)(int rank, const X(iodim) *dims, \
andrew@0 250 int howmany_rank, \
andrew@0 251 const X(iodim) *howmany_dims, \
andrew@0 252 R *in, R *out, \
andrew@0 253 const X(r2r_kind) *kind, unsigned flags); \
andrew@0 254 FFTW_EXTERN void X(execute_r2r)(const X(plan) p, R *in, R *out); \
andrew@0 255 \
andrew@0 256 FFTW_EXTERN void X(destroy_plan)(X(plan) p); \
andrew@0 257 FFTW_EXTERN void X(forget_wisdom)(void); \
andrew@0 258 FFTW_EXTERN void X(cleanup)(void); \
andrew@0 259 \
andrew@0 260 FFTW_EXTERN void X(set_timelimit)(double); \
andrew@0 261 \
andrew@0 262 FFTW_EXTERN void X(plan_with_nthreads)(int nthreads); \
andrew@0 263 FFTW_EXTERN int X(init_threads)(void); \
andrew@0 264 FFTW_EXTERN void X(cleanup_threads)(void); \
andrew@0 265 \
andrew@0 266 FFTW_EXTERN void X(export_wisdom_to_file)(FILE *output_file); \
andrew@0 267 FFTW_EXTERN char *X(export_wisdom_to_string)(void); \
andrew@0 268 FFTW_EXTERN void X(export_wisdom)(void (*write_char)(char c, void *), \
andrew@0 269 void *data); \
andrew@0 270 FFTW_EXTERN int X(import_system_wisdom)(void); \
andrew@0 271 FFTW_EXTERN int X(import_wisdom_from_file)(FILE *input_file); \
andrew@0 272 FFTW_EXTERN int X(import_wisdom_from_string)(const char *input_string); \
andrew@0 273 FFTW_EXTERN int X(import_wisdom)(int (*read_char)(void *), void *data); \
andrew@0 274 \
andrew@0 275 FFTW_EXTERN void X(fprint_plan)(const X(plan) p, FILE *output_file); \
andrew@0 276 FFTW_EXTERN void X(print_plan)(const X(plan) p); \
andrew@0 277 \
andrew@0 278 FFTW_EXTERN void *X(malloc)(size_t n); \
andrew@0 279 FFTW_EXTERN void X(free)(void *p); \
andrew@0 280 \
andrew@0 281 FFTW_EXTERN void X(flops)(const X(plan) p, \
andrew@0 282 double *add, double *mul, double *fmas); \
andrew@0 283 FFTW_EXTERN double X(estimate_cost)(const X(plan) p); \
andrew@0 284 \
andrew@0 285 FFTW_EXTERN const char X(version)[]; \
andrew@0 286 FFTW_EXTERN const char X(cc)[]; \
andrew@0 287 FFTW_EXTERN const char X(codelet_optim)[];
andrew@0 288
andrew@0 289
andrew@0 290 /* end of FFTW_DEFINE_API macro */
andrew@0 291
andrew@0 292 FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex)
andrew@0 293 FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex)
andrew@0 294 FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex)
andrew@0 295
andrew@0 296 #define FFTW_FORWARD (-1)
andrew@0 297 #define FFTW_BACKWARD (+1)
andrew@0 298
andrew@0 299 #define FFTW_NO_TIMELIMIT (-1.0)
andrew@0 300
andrew@0 301 /* documented flags */
andrew@0 302 #define FFTW_MEASURE (0U)
andrew@0 303 #define FFTW_DESTROY_INPUT (1U << 0)
andrew@0 304 #define FFTW_UNALIGNED (1U << 1)
andrew@0 305 #define FFTW_CONSERVE_MEMORY (1U << 2)
andrew@0 306 #define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */
andrew@0 307 #define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */
andrew@0 308 #define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */
andrew@0 309 #define FFTW_ESTIMATE (1U << 6)
andrew@0 310
andrew@0 311 /* undocumented beyond-guru flags */
andrew@0 312 #define FFTW_ESTIMATE_PATIENT (1U << 7)
andrew@0 313 #define FFTW_BELIEVE_PCOST (1U << 8)
andrew@0 314 #define FFTW_NO_DFT_R2HC (1U << 9)
andrew@0 315 #define FFTW_NO_NONTHREADED (1U << 10)
andrew@0 316 #define FFTW_NO_BUFFERING (1U << 11)
andrew@0 317 #define FFTW_NO_INDIRECT_OP (1U << 12)
andrew@0 318 #define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */
andrew@0 319 #define FFTW_NO_RANK_SPLITS (1U << 14)
andrew@0 320 #define FFTW_NO_VRANK_SPLITS (1U << 15)
andrew@0 321 #define FFTW_NO_VRECURSE (1U << 16)
andrew@0 322 #define FFTW_NO_SIMD (1U << 17)
andrew@0 323 #define FFTW_NO_SLOW (1U << 18)
andrew@0 324 #define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19)
andrew@0 325 #define FFTW_ALLOW_PRUNING (1U << 20)
andrew@0 326
andrew@0 327 #ifdef __cplusplus
andrew@0 328 } /* extern "C" */
andrew@0 329 #endif /* __cplusplus */
andrew@0 330
andrew@0 331 #endif /* FFTW3_H */