26 #if defined (HAVE_CONFIG_H)
33 #if defined (HAVE_FFTW3_H)
142 #if defined (HAVE_FFTW)
144 int nargin = args.length ();
146 if (nargin < 1 || nargin > 2)
151 std::string arg0 = args(0).xstring_value (
"fftw: first argument must be a string");
153 if (arg0 ==
"planner")
158 std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower);
160 std::string arg1 = args(1).xstring_value (
"fftw: METHOD must be a string");
162 std::transform (arg1.begin (), arg1.end (), arg1.begin (), tolower);
168 if (arg1 ==
"estimate")
173 else if (arg1 ==
"measure")
178 else if (arg1 ==
"patient")
183 else if (arg1 ==
"exhaustive")
188 else if (arg1 ==
"hybrid")
194 error (
"fftw: unrecognized planner METHOD");
227 else if (arg0 ==
"dwisdom")
235 std::string arg1 = args(1).xstring_value (
"fftw: WISDOM must be a string");
237 char *str = fftw_export_wisdom_to_string ();
239 error (
"fftw: could not get current FFTW wisdom");
241 std::string wisdom_str (str);
244 if (arg1.length () < 1)
245 fftw_forget_wisdom ();
246 else if (! fftw_import_wisdom_from_string (arg1.c_str ()))
247 error (
"fftw: could not import supplied WISDOM");
253 char *str = fftw_export_wisdom_to_string ();
255 error (
"fftw: could not get current FFTW wisdom");
257 std::string wisdom_str (str);
262 else if (arg0 ==
"swisdom")
271 std::string arg1 = args(1).xstring_value (
"fftw: WISDOM must be a string");
273 char *str = fftwf_export_wisdom_to_string ();
275 error (
"fftw: could not get current FFTW wisdom");
277 std::string wisdom_str (str);
280 if (arg1.length () < 1)
281 fftwf_forget_wisdom ();
282 else if (! fftwf_import_wisdom_from_string (arg1.c_str ()))
283 error (
"fftw: could not import supplied WISDOM");
289 char *str = fftwf_export_wisdom_to_string ();
291 error (
"fftw: could not get current FFTW wisdom");
293 std::string wisdom_str (str);
298 else if (arg0 ==
"threads")
302 if (! args(1).is_real_scalar ())
303 error (
"fftw: setting threads needs one integer argument");
305 int nthreads = args(1).int_value();
307 error (
"fftw: number of threads must be >=1");
309 #if defined (HAVE_FFTW3_THREADS)
314 #if defined (HAVE_FFTW3F_THREADS)
321 #if defined (HAVE_FFTW3_THREADS)
328 error (
"fftw: unrecognized argument");
334 octave_unused_parameter (args);
static FftwMethod method(void)
static FftwMethod method(void)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
OCTINTERP_API void print_usage(void)
void error(const char *fmt,...)
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
ColumnVector transform(const Matrix &m, double x, double y, double z)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval