47 static int real_to_complex_1d(
float *real_data,
float *complex_data,
int n);
48 static int complex_to_real_1d(
float *complex_data,
float *real_data,
int n);
49 static int complex_to_complex_1d_inplace(std::complex<float> *data,
int n);
50 static int complex_to_complex_2d_inplace(std::complex<float> *data,
int nx,
int ny);
51 static int complex_to_complex_1d_f(
float *in,
float *out,
int n);
52 static int complex_to_complex_1d_b(
float *in,
float *out,
int n);
53 static int real_to_complex_nd(
float *real_data,
float *complex_data,
int nx,
int ny,
55 static int complex_to_real_nd(
float *complex_data,
float *real_data,
int nx,
int ny,
57 static int complex_to_complex_nd(
float *complex_data_in,
float *complex_data_out,
int nx,
int ny,
int nz);
58 static inline float *fftmalloc(
int n) {
return (
float*)fftw_malloc(n*
sizeof(
float)); }
59 static inline void fftfree(
float *mem) { fftw_free(mem); }
64 static int initialize_plan_cache();
67#ifdef FFTW_PLAN_CACHING
68#define EMFFTW3_CACHE_SIZE 32
69 static const int EMAN2_REAL_2_COMPLEX;
70 static const int EMAN2_COMPLEX_2_REAL;
71 static const int EMAN2_COMPLEX_2_COMPLEX;
107 fftwf_plan get_plan(
const int rank,
const int x,
const int y,
const int z,
const int r2c_flag,
const int ip_flag, fftwf_complex* complex_data,
float* real_data);
116 int rank[EMFFTW3_CACHE_SIZE];
118 int plan_dims[EMFFTW3_CACHE_SIZE][3];
120 int r2c[EMFFTW3_CACHE_SIZE];
122 fftwf_plan fftwplans[EMFFTW3_CACHE_SIZE];
124 int ip[EMFFTW3_CACHE_SIZE];
127 static EMfftw3_cache plan_cache;
161 static int real_to_complex_1d(
float *real_data,
float *complex_data,
int n);
162 static int complex_to_real_1d(
float *complex_data,
float *real_data,
int n);
164 static int real_to_complex_nd(
float *real_data,
float *complex_data,
int nx,
int ny,
int nz);
165 static int complex_to_real_nd(
float *complex_data,
float *real_data,
int nx,
int ny,
int nz);
181 static int real_to_complex_1d(
float *real_data,
float *complex_data,
int n);
182 static int complex_to_real_1d(
float *complex_data,
float *real_data,
int n);
184 static int real_to_complex_nd(
float *real_data,
float *complex_data,
int nx,
int ny,
int nz);
185 static int complex_to_real_nd(
float *complex_data,
float *real_data,
int nx,
int ny,
int nz);
186 static inline float *fftmalloc(
int n) {
return (
float*)malloc(n*
sizeof(
float)); }
187 static inline void fftfree(
float *mem) { free(mem) }
190 static int real_to_complex_2d(
float *real_data,
float *complex_data,
int nx,
int ny);
191 static int complex_to_real_2d(
float *complex_data,
float *real_data,
int nx,
int ny);
192 static int real_to_complex_3d(
float *real_data,
float *complex_data,
int nx,
int ny,
int nz);
193 static int complex_to_real_3d(
float *complex_data,
float *real_data,
int nx,
int ny,
int nz);
195 class time_sqrt_n :
public std::unary_function<float, float> {
197 time_sqrt_n(
int n) : n_(n), factor(
sqrt(float(n_))) {}
204 class divide_sqrt_n :
public std::unary_function<float, float> {
206 divide_sqrt_n(
int n) : n_(n), factor(
sqrt(float(n_))) {}
EMData * sqrt() const
return square root of current image
float & operator()(const int ix, const int iy, const int iz) const
Overload operator() for array indexing.