26 #if defined (HAVE_CONFIG_H)
33 #if defined (HAVE_FFTW3_H)
144 #if defined (HAVE_FFTW)
146 int nargin = args.length ();
148 if (nargin < 1 || nargin > 2)
153 std::string arg0 = args(0).
xstring_value (
"fftw: first argument must be a string");
155 if (arg0 ==
"planner")
160 std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower);
162 std::string arg1 = args(1).xstring_value (
"fftw: METHOD must be a string");
164 std::transform (arg1.begin (), arg1.end (), arg1.begin (), tolower);
170 if (arg1 ==
"estimate")
175 else if (arg1 ==
"measure")
180 else if (arg1 ==
"patient")
185 else if (arg1 ==
"exhaustive")
190 else if (arg1 ==
"hybrid")
196 error (
"fftw: unrecognized planner METHOD");
229 else if (arg0 ==
"dwisdom")
237 std::string arg1 = args(1).xstring_value (
"fftw: WISDOM must be a string");
239 char *str = fftw_export_wisdom_to_string ();
241 error (
"fftw: could not get current FFTW wisdom");
243 std::string wisdom_str (str);
246 if (arg1.length () < 1)
247 fftw_forget_wisdom ();
248 else if (! fftw_import_wisdom_from_string (arg1.c_str ()))
249 error (
"fftw: could not import supplied WISDOM");
255 char *str = fftw_export_wisdom_to_string ();
257 error (
"fftw: could not get current FFTW wisdom");
259 std::string wisdom_str (str);
264 else if (arg0 ==
"swisdom")
273 std::string arg1 = args(1).xstring_value (
"fftw: WISDOM must be a string");
275 char *str = fftwf_export_wisdom_to_string ();
277 error (
"fftw: could not get current FFTW wisdom");
279 std::string wisdom_str (str);
282 if (arg1.length () < 1)
283 fftwf_forget_wisdom ();
284 else if (! fftwf_import_wisdom_from_string (arg1.c_str ()))
285 error (
"fftw: could not import supplied WISDOM");
291 char *str = fftwf_export_wisdom_to_string ();
293 error (
"fftw: could not get current FFTW wisdom");
295 std::string wisdom_str (str);
300 else if (arg0 ==
"threads")
304 if (! args(1).is_real_scalar ())
305 error (
"fftw: setting threads needs one integer argument");
307 int nthreads = args(1).int_value();
309 error (
"fftw: number of threads must be >=1");
311 #if defined (HAVE_FFTW3_THREADS)
316 #if defined (HAVE_FFTW3F_THREADS)
323 #if defined (HAVE_FFTW3_THREADS)
330 error (
"fftw: unrecognized argument");
336 octave_unused_parameter (args);
404 OCTAVE_END_NAMESPACE(
octave)
static FftwMethod method()
static FftwMethod method()
std::string xstring_value(const char *fmt,...) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
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()) ? '\'' :'"'))