23 #if !defined (octave_oct_fftw_h)
24 #define octave_oct_fftw_h 1
28 #if defined (HAVE_FFTW3_H)
35 #if defined (HAVE_FFTW)
59 static bool instance_ok (
void);
67 static fftw_plan dummy;
70 ? instance->do_create_plan (dir, rank, dims, howmany, stride,
80 static fftw_plan dummy;
83 ? instance->do_create_plan (rank, dims, howmany, stride, dist,
92 return instance_ok () ? instance->do_method () : dummy;
99 return instance_ok () ? instance->do_method (_meth) : dummy;
102 #if defined (HAVE_FFTW3F_THREADS)
105 if (instance_ok () && _nthreads != threads ())
107 instance->nthreads = _nthreads;
108 fftw_plan_with_nthreads (_nthreads);
110 instance->rplan = instance->plan[0] = instance->plan[1] = 0;
116 return instance_ok () ? instance->nthreads : 0;
133 do_create_plan (
int dir,
const int rank,
const dim_vector dims,
139 do_create_plan (
const int rank,
const dim_vector dims,
143 FftwMethod do_method (
void);
145 FftwMethod do_method (FftwMethod _meth);
192 #if defined (HAVE_FFTW3_THREADS)
220 static bool instance_ok (
void);
228 static fftwf_plan dummy;
230 return instance_ok ()
231 ? instance->do_create_plan (dir, rank, dims, howmany, stride,
241 static fftwf_plan dummy;
243 return instance_ok ()
244 ? instance->do_create_plan (rank, dims, howmany, stride, dist,
253 return instance_ok () ? instance->do_method () : dummy;
260 return instance_ok () ? instance->do_method (_meth) : dummy;
263 #if defined (HAVE_FFTW3F_THREADS)
266 if (instance_ok () && _nthreads != threads ())
268 instance->nthreads = _nthreads;
269 fftwf_plan_with_nthreads (_nthreads);
271 instance->rplan = instance->plan[0] = instance->plan[1] = 0;
277 return instance_ok () ? instance->nthreads : 0;
294 do_create_plan (
int dir,
const int rank,
const dim_vector dims,
300 do_create_plan (
const int rank,
const dim_vector dims,
304 FftwMethod do_method (
void);
306 FftwMethod do_method (FftwMethod _meth);
353 #if defined (HAVE_FFTW3F_THREADS)
365 static int fft (
const double *in,
Complex *out,
size_t npts,
381 static int fft (
const float *in,
FloatComplex *out,
size_t npts,
static octave_fftw_planner * instance
static FftwMethod method(FftwMethod _meth)
static octave_float_fftw_planner * instance
F77_RET_T const double const double double * d
static FftwMethod method(void)
static fftw_plan create_plan(int dir, const int rank, const dim_vector dims, octave_idx_type howmany, octave_idx_type stride, octave_idx_type dist, const Complex *in, Complex *out)
static FftwMethod method(void)
static FftwMethod method(FftwMethod _meth)
static fftw_plan create_plan(const int rank, const dim_vector dims, octave_idx_type howmany, octave_idx_type stride, octave_idx_type dist, const double *in, Complex *out)
static fftwf_plan create_plan(int dir, const int rank, const dim_vector dims, octave_idx_type howmany, octave_idx_type stride, octave_idx_type dist, const FloatComplex *in, FloatComplex *out)
std::complex< float > FloatComplex
std::complex< double > Complex
static void cleanup_instance(void)
static fftwf_plan create_plan(const int rank, const dim_vector dims, octave_idx_type howmany, octave_idx_type stride, octave_idx_type dist, const float *in, FloatComplex *out)
static void threads(int _nthreads)
static void cleanup_instance(void)
static void threads(int _nthreads)