📄 fftw-int.h
字号:
/* * Copyright (c) 1997-1999, 2003 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *//* fftw.h -- system-wide definitions *//* $Id: fftw-int.h,v 1.54 2003/03/16 23:43:46 stevenj Exp $ */#ifndef FFTW_INT_H#define FFTW_INT_H#include "config.h"#include "fftw.h"#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//****************************************************************************//* Private Functions *//****************************************************************************/extern fftw_twiddle *fftw_create_twiddle(int n, const fftw_codelet_desc *d);extern void fftw_destroy_twiddle(fftw_twiddle *tw);extern void fftw_strided_copy(int, fftw_complex *, int, fftw_complex *);extern void fftw_executor_simple(int, const fftw_complex *, fftw_complex *, fftw_plan_node *, int, int, fftw_recurse_kind recurse_kind);extern fftwnd_plan fftwnd_create_plan_aux(int rank, const int *n, fftw_direction dir, int flags);extern fftw_plan *fftwnd_new_plan_array(int rank);extern fftw_plan *fftwnd_create_plans_generic(fftw_plan *plans, int rank, const int *n, fftw_direction dir, int flags);extern fftw_plan *fftwnd_create_plans_specific(fftw_plan *plans, int rank, const int *n, const int *n_after, fftw_direction dir, int flags, fftw_complex *in, int istride, fftw_complex *out, int ostride);extern int fftwnd_work_size(int rank, const int *n, int flags, int ncopies);extern void fftwnd_aux(fftwnd_plan p, int cur_dim, fftw_complex *in, int istride, fftw_complex *out, int ostride, fftw_complex *work);extern void fftwnd_aux_howmany(fftwnd_plan p, int cur_dim, int howmany, fftw_complex *in, int istride, int idist, fftw_complex *out, int ostride, int odist, fftw_complex *work);/* wisdom prototypes */enum fftw_wisdom_category { FFTW_WISDOM, RFFTW_WISDOM};extern int fftw_wisdom_lookup(int n, int flags, fftw_direction dir, enum fftw_wisdom_category category, int istride, int ostride, enum fftw_node_type *type, int *signature, fftw_recurse_kind *recurse_kind, int replace_p);extern void fftw_wisdom_add(int n, int flags, fftw_direction dir, enum fftw_wisdom_category cat, int istride, int ostride, enum fftw_node_type type, int signature, fftw_recurse_kind recurse_kind);/* Private planner functions: */extern double fftw_estimate_node(fftw_plan_node *p);extern fftw_plan_node *fftw_make_node_notw(int size, const fftw_codelet_desc *config);extern fftw_plan_node *fftw_make_node_real2hc(int size, const fftw_codelet_desc *config);extern fftw_plan_node *fftw_make_node_hc2real(int size, const fftw_codelet_desc *config);extern fftw_plan_node *fftw_make_node_twiddle(int n, const fftw_codelet_desc *config, fftw_plan_node *recurse, int flags);extern fftw_plan_node *fftw_make_node_hc2hc(int n, fftw_direction dir, const fftw_codelet_desc *config, fftw_plan_node *recurse, int flags);extern fftw_plan_node *fftw_make_node_generic(int n, int size, fftw_generic_codelet *codelet, fftw_plan_node *recurse, int flags);extern fftw_plan_node *fftw_make_node_rgeneric(int n, int size, fftw_direction dir, fftw_rgeneric_codelet * codelet, fftw_plan_node *recurse, int flags);extern int fftw_factor(int n);extern fftw_plan_node *fftw_make_node(void);extern fftw_plan fftw_make_plan(int n, fftw_direction dir, fftw_plan_node *root, int flags, enum fftw_node_type wisdom_type, int wisdom_signature, fftw_recurse_kind recurse_kind, int vector_size);extern void fftw_use_plan(fftw_plan p);extern void fftw_use_node(fftw_plan_node *p);extern void fftw_destroy_plan_internal(fftw_plan p);extern fftw_plan fftw_pick_better(fftw_plan p1, fftw_plan p2);extern fftw_plan fftw_lookup(fftw_plan *table, int n, int flags, int vector_size);extern void fftw_insert(fftw_plan *table, fftw_plan this_plan);extern void fftw_make_empty_table(fftw_plan *table);extern void fftw_destroy_table(fftw_plan *table);extern void fftw_complete_twiddle(fftw_plan_node *p, int n);extern fftw_plan_node *fftw_make_node_rader(int n, int size, fftw_direction dir, fftw_plan_node *recurse, int flags);extern fftw_rader_data *fftw_rader_top;/* undocumented debugging hook */typedef void (*fftw_plan_hook_ptr) (fftw_plan plan);extern DL_IMPORT(fftw_plan_hook_ptr) fftw_plan_hook;extern DL_IMPORT(fftw_plan_hook_ptr) rfftw_plan_hook;/****************************************************************************//* Overflow-safe multiply *//****************************************************************************//* The Rader routines do a lot of operations of the form (x * y) % p, which are vulnerable to overflow problems for large p. To get around this, we either use "long long" arithmetic (if it is available and double the size of int), or default to a subroutine defined in twiddle.c. */#if defined(FFTW_ENABLE_UNSAFE_MULMOD)# define MULMOD(x,y,p) (((x) * (y)) % (p))#elif defined(LONGLONG_IS_TWOINTS)# define MULMOD(x,y,p) ((int) ((((long long) (x)) * ((long long) (y))) \ % ((long long) (p))))#else# define USE_FFTW_SAFE_MULMOD# define MULMOD(x,y,p) fftw_safe_mulmod(x,y,p)extern int fftw_safe_mulmod(int x, int y, int p);#endif/****************************************************************************//* Floating Point Types *//****************************************************************************//* * We use these definitions to make it easier for people to change * FFTW to use long double and similar types. You shouldn't have to * change this just to use float or double. *//* * Change this if your floating-point constants need to be expressed * in a special way. For example, if fftw_real is long double, you * will need to append L to your fp constants to make them of the * same precision. Do this by changing "x" below to "x##L". */#define FFTW_KONST(x) ((fftw_real) x)/* * Ordinarily, we use the standard sin/cos functions to compute trig. * constants. You'll need to change these if fftw_real has more * than double precision. */#define FFTW_TRIG_SIN sin#define FFTW_TRIG_COS costypedef double FFTW_TRIG_REAL; /* the argument type for sin and cos */#define FFTW_K2PI FFTW_KONST(6.2831853071795864769252867665590057683943388)/****************************************************************************//* gcc/x86 hacks *//****************************************************************************//* * gcc 2.[78].x and x86 specific hacks. These macros align the stack * pointer so that the double precision temporary variables in the * codelets will be aligned to a multiple of 8 bytes (*way* faster on * pentium and pentiumpro) */#ifdef __GNUC__# ifdef __i386__# ifdef FFTW_ENABLE_I386_HACKS# ifndef FFTW_GCC_ALIGNS_STACK# ifndef FFTW_ENABLE_FLOAT# define FFTW_USING_I386_HACKS# define HACK_ALIGN_STACK_EVEN { \ if ((((long) (__builtin_alloca(0))) & 0x7)) __builtin_alloca(4); \ }# define HACK_ALIGN_STACK_ODD { \ if (!(((long) (__builtin_alloca(0))) & 0x7)) __builtin_alloca(4); \ }# endif /* ! FFTW_ENABLE_FLOAT */# endif /* ! FFTW_GCC_ALIGNS_STACK */# endif /* FFTW_ENABLE_I386_HACKS */# ifdef FFTW_DEBUG_ALIGNMENT# define ASSERT_ALIGNED_DOUBLE { \ double __foo; \ if ((((long) &__foo) & 0x7)) abort(); \ }# endif /* FFTW_DEBUG_ALIGNMENT */# endif /* __i386__ */#endif /* __GNUC__ */#ifndef HACK_ALIGN_STACK_EVEN# define HACK_ALIGN_STACK_EVEN {}#endif#ifndef HACK_ALIGN_STACK_ODD# define HACK_ALIGN_STACK_ODD {}#endif#ifndef ASSERT_ALIGNED_DOUBLE# define ASSERT_ALIGNED_DOUBLE {}#endif/****************************************************************************//* Timers *//****************************************************************************//* * Here, you can use all the nice timers available in your machine. *//* * Things you should define to include your own clock: fftw_time -- the data type used to store a time
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -