C:/cmcintos/defOrgs/source/include/fftw3.h

00001 /*
00002  * Copyright (c) 2003 Matteo Frigo
00003  * Copyright (c) 2003 Massachusetts Institute of Technology
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00020 
00021 /* header file for fftw3 */
00022 /* $Id: fftw3.h,v 1.60 2003/04/15 18:53:44 stevenj Exp $ */
00023 
00024 #ifndef FFTW3_H
00025 #define FFTW3_H
00026 
00027 #if defined(__ICC) || defined(_MSC_VER)
00028 #pragma comment ( lib, "fftw3" )
00029 #endif
00030 
00031 #include <stdio.h>
00032 
00033 #ifdef __cplusplus
00034 extern "C"
00035 {
00036 #endif /* __cplusplus */
00037 
00038 /* If <complex.h> is included, use the C99 complex type.  Otherwise
00039    define a type bit-compatible with C99 complex */
00040 #ifdef _Complex_I
00041 #  define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C
00042 #else
00043 #  define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2]
00044 #endif
00045 
00046 #define FFTW_CONCAT(prefix, name) prefix ## name
00047 #define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name)
00048 #define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name)
00049 #define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name)
00050 
00051 
00052 enum fftw_r2r_kind_do_not_use_me {
00053      FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2,
00054      FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6,
00055      FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10
00056 };
00057 
00058 struct fftw_iodim_do_not_use_me {
00059      int n;                     /* dimension size */
00060      int is;                    /* input stride */
00061      int os;                    /* output stride */
00062 };
00063 
00064 /*
00065   huge second-order macro that defines prototypes for all API
00066   functions.  We expand this macro for each supported precision
00067  
00068   X: name-mangling macro
00069   R: real data type
00070   C: complex data type
00071 */
00072 
00073 #define FFTW_DEFINE_API(X, R, C)                                        \
00074                                                                         \
00075 FFTW_DEFINE_COMPLEX(R, C);                                              \
00076                                                                         \
00077 typedef struct X(plan_s) *X(plan);                                      \
00078                                                                         \
00079 typedef struct fftw_iodim_do_not_use_me X(iodim);                       \
00080                                                                         \
00081 typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind);                   \
00082                                                                         \
00083 void X(execute)(const X(plan) p);                                       \
00084                                                                         \
00085 X(plan) X(plan_dft)(int rank, const int *n,                             \
00086                     C *in, C *out, int sign, unsigned flags);           \
00087                                                                         \
00088 X(plan) X(plan_dft_1d)(int n, C *in, C *out, int sign,                  \
00089                        unsigned flags);                                 \
00090 X(plan) X(plan_dft_2d)(int nx, int ny,                                  \
00091                        C *in, C *out, int sign, unsigned flags);        \
00092 X(plan) X(plan_dft_3d)(int nx, int ny, int nz,                          \
00093                        C *in, C *out, int sign, unsigned flags);        \
00094                                                                         \
00095 X(plan) X(plan_many_dft)(int rank, const int *n,                        \
00096                          int howmany,                                   \
00097                          C *in, const int *inembed,                     \
00098                          int istride, int idist,                        \
00099                          C *out, const int *onembed,                    \
00100                          int ostride, int odist,                        \
00101                          int sign, unsigned flags);                     \
00102                                                                         \
00103 X(plan) X(plan_guru_dft)(int rank, const X(iodim) *dims,                \
00104                          int howmany_rank,                              \
00105                          const X(iodim) *howmany_dims,                  \
00106                          C *in, C *out,                                 \
00107                          int sign, unsigned flags);                     \
00108 X(plan) X(plan_guru_split_dft)(int rank, const X(iodim) *dims,          \
00109                          int howmany_rank,                              \
00110                          const X(iodim) *howmany_dims,                  \
00111                          R *ri, R *ii, R *ro, R *io,                    \
00112                          unsigned flags);                               \
00113                                                                         \
00114 void X(execute_dft)(const X(plan) p, C *in, C *out);                    \
00115 void X(execute_split_dft)(const X(plan) p, R *ri, R *ii, R *ro, R *io); \
00116                                                                         \
00117 X(plan) X(plan_many_dft_r2c)(int rank, const int *n,                    \
00118                              int howmany,                               \
00119                              R *in, const int *inembed,                 \
00120                              int istride, int idist,                    \
00121                              C *out, const int *onembed,                \
00122                              int ostride, int odist,                    \
00123                              unsigned flags);                           \
00124                                                                         \
00125 X(plan) X(plan_dft_r2c)(int rank, const int *n,                         \
00126                         R *in, C *out, unsigned flags);                 \
00127                                                                         \
00128 X(plan) X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags);          \
00129 X(plan) X(plan_dft_r2c_2d)(int nx, int ny,                              \
00130                            R *in, C *out, unsigned flags);              \
00131 X(plan) X(plan_dft_r2c_3d)(int nx, int ny,                              \
00132                            int nz,                                      \
00133                            R *in, C *out, unsigned flags);              \
00134                                                                         \
00135                                                                         \
00136 X(plan) X(plan_many_dft_c2r)(int rank, const int *n,                    \
00137                              int howmany,                               \
00138                              C *in, const int *inembed,                 \
00139                              int istride, int idist,                    \
00140                              R *out, const int *onembed,                \
00141                              int ostride, int odist,                    \
00142                              unsigned flags);                           \
00143                                                                         \
00144 X(plan) X(plan_dft_c2r)(int rank, const int *n,                         \
00145                         C *in, R *out, unsigned flags);                 \
00146                                                                         \
00147 X(plan) X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags);          \
00148 X(plan) X(plan_dft_c2r_2d)(int nx, int ny,                              \
00149                            C *in, R *out, unsigned flags);              \
00150 X(plan) X(plan_dft_c2r_3d)(int nx, int ny,                              \
00151                            int nz,                                      \
00152                            C *in, R *out, unsigned flags);              \
00153                                                                         \
00154 X(plan) X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims,            \
00155                              int howmany_rank,                          \
00156                              const X(iodim) *howmany_dims,              \
00157                              R *in, C *out,                             \
00158                              unsigned flags);                           \
00159 X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims,            \
00160                              int howmany_rank,                          \
00161                              const X(iodim) *howmany_dims,              \
00162                              C *in, R *out,                             \
00163                              unsigned flags);                           \
00164                                                                         \
00165 X(plan) X(plan_guru_split_dft_r2c)(int rank, const X(iodim) *dims,      \
00166                              int howmany_rank,                          \
00167                              const X(iodim) *howmany_dims,              \
00168                              R *in, R *ro, R *io,                       \
00169                              unsigned flags);                           \
00170 X(plan) X(plan_guru_split_dft_c2r)(int rank, const X(iodim) *dims,      \
00171                              int howmany_rank,                          \
00172                              const X(iodim) *howmany_dims,              \
00173                              R *ri, R *ii, R *out,                      \
00174                              unsigned flags);                           \
00175                                                                         \
00176 void X(execute_dft_r2c)(const X(plan) p, R *in, C *out);                \
00177 void X(execute_dft_c2r)(const X(plan) p, C *in, R *out);                \
00178                                                                         \
00179 void X(execute_split_dft_r2c)(const X(plan) p, R *in, R *ro, R *io);    \
00180 void X(execute_split_dft_c2r)(const X(plan) p, R *ri, R *ii, R *out);   \
00181                                                                         \
00182 X(plan) X(plan_many_r2r)(int rank, const int *n,                        \
00183                          int howmany,                                   \
00184                          R *in, const int *inembed,                     \
00185                          int istride, int idist,                        \
00186                          R *out, const int *onembed,                    \
00187                          int ostride, int odist,                        \
00188                          const X(r2r_kind) *kind, unsigned flags);      \
00189                                                                         \
00190 X(plan) X(plan_r2r)(int rank, const int *n, R *in, R *out,              \
00191                     const X(r2r_kind) *kind, unsigned flags);           \
00192                                                                         \
00193 X(plan) X(plan_r2r_1d)(int n, R *in, R *out,                            \
00194                        X(r2r_kind) kind, unsigned flags);               \
00195 X(plan) X(plan_r2r_2d)(int nx, int ny, R *in, R *out,                   \
00196                        X(r2r_kind) kindx, X(r2r_kind) kindy,            \
00197                        unsigned flags);                                 \
00198 X(plan) X(plan_r2r_3d)(int nx, int ny, int nz,                          \
00199                        R *in, R *out, X(r2r_kind) kindx,                \
00200                        X(r2r_kind) kindy, X(r2r_kind) kindz,            \
00201                        unsigned flags);                                 \
00202                                                                         \
00203 X(plan) X(plan_guru_r2r)(int rank, const X(iodim) *dims,                \
00204                          int howmany_rank,                              \
00205                          const X(iodim) *howmany_dims,                  \
00206                          R *in, R *out,                                 \
00207                          const X(r2r_kind) *kind, unsigned flags);      \
00208 void X(execute_r2r)(const X(plan) p, R *in, R *out);                    \
00209                                                                         \
00210 void X(destroy_plan)(X(plan) p);                                        \
00211 void X(forget_wisdom)(void);                                            \
00212 void X(cleanup)(void);                                                  \
00213                                                                         \
00214 void X(plan_with_nthreads)(int nthreads);                               \
00215 int X(init_threads)(void);                                              \
00216 void X(cleanup_threads)(void);                                          \
00217                                                                         \
00218 void X(export_wisdom_to_file)(FILE *output_file);                       \
00219 char *X(export_wisdom_to_string)(void);                                 \
00220 void X(export_wisdom)(void (*write_char)(char c, void *), void *data);  \
00221 int X(import_system_wisdom)(void);                                      \
00222 int X(import_wisdom_from_file)(FILE *input_file);                       \
00223 int X(import_wisdom_from_string)(const char *input_string);             \
00224 int X(import_wisdom)(int (*read_char)(void *), void *data);             \
00225                                                                         \
00226 void X(fprint_plan)(const X(plan) p, FILE *output_file);                \
00227 void X(print_plan)(const X(plan) p);                                    \
00228                                                                         \
00229 void *X(malloc)(size_t n);                                              \
00230 void X(free)(void *p);                                                  \
00231                                                                         \
00232 void X(flops)(const X(plan) p, double *add, double *mul, double *fma);  \
00233                                                                         \
00234 extern const char X(version)[];                                         \
00235 extern const char X(cc)[];                                              \
00236 extern const char X(codelet_optim)[];
00237 
00238 
00239 /* end of FFTW_DEFINE_API macro */
00240 
00241 FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex)
00242 FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex)
00243 FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex)
00244 
00245 #define FFTW_FORWARD (-1)
00246 #define FFTW_BACKWARD (+1)
00247 
00248 /* documented flags */
00249 #define FFTW_MEASURE (0U)
00250 #define FFTW_DESTROY_INPUT (1U << 0)
00251 #define FFTW_UNALIGNED (1U << 1)
00252 #define FFTW_CONSERVE_MEMORY (1U << 2)
00253 #define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */
00254 #define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */
00255 #define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */
00256 #define FFTW_ESTIMATE (1U << 6)
00257 
00258 /* undocumented beyond-guru flags */
00259 #define FFTW_ESTIMATE_PATIENT (1U << 7)
00260 #define FFTW_BELIEVE_PCOST (1U << 8)
00261 #define FFTW_DFT_R2HC_ICKY (1U << 9)
00262 #define FFTW_NONTHREADED_ICKY (1U << 10)
00263 #define FFTW_NO_BUFFERING (1U << 11)
00264 #define FFTW_NO_INDIRECT_OP (1U << 12)
00265 #define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */
00266 #define FFTW_NO_RANK_SPLITS (1U << 14)
00267 #define FFTW_NO_VRANK_SPLITS (1U << 15)
00268 #define FFTW_NO_VRECURSE (1U << 16)
00269 
00270 #define FFTW_NO_SIMD (1U << 17)
00271 
00272 #ifdef __cplusplus
00273 }  /* extern "C" */
00274 #endif /* __cplusplus */
00275 
00276 #endif /* FFTW3_H */

Generated on Wed Jul 19 13:05:17 2006 for IDO by  doxygen 1.4.7