From b1662831100e23fb9612767d6b5df95face6f2b5 Mon Sep 17 00:00:00 2001 From: ahbarnett Date: Tue, 14 May 2024 22:29:11 -0400 Subject: [PATCH] fixed Mwrap MEX interface to remove chkbnds; fixed mat/oct tests; turned attempted opts.chkbnds change from default into stderr warning only (no nonzero ier return value), since that is more graceful --- include/finufft_errors.h | 1 - matlab/finufft.cpp | 125 +++++++++++++++-------------- matlab/finufft.mw | 3 - matlab/finufft_plan.m | 152 ------------------------------------ matlab/test/check_finufft.m | 1 + src/finufft.cpp | 9 +-- 6 files changed, 64 insertions(+), 227 deletions(-) diff --git a/include/finufft_errors.h b/include/finufft_errors.h index b2555d522..2feaa131a 100644 --- a/include/finufft_errors.h +++ b/include/finufft_errors.h @@ -23,5 +23,4 @@ #define FINUFFT_ERR_BINSIZE_NOTVALID 18 #define FINUFFT_ERR_INSUFFICIENT_SHMEM 19 #define FINUFFT_ERR_NUM_NU_PTS_INVALID 20 -#define FINUFFT_WARN_CHKBND_NOT_DEFAULT 21 #endif diff --git a/matlab/finufft.cpp b/matlab/finufft.cpp index db348a431..9a805dade 100644 --- a/matlab/finufft.cpp +++ b/matlab/finufft.cpp @@ -2,7 +2,7 @@ /* Automatically generated by mwrap */ /* --------------------------------------------------- */ -/* Code generated by mwrap 1.0 */ +/* Code generated by mwrap 1.1 */ /* Copyright statement for mwrap: @@ -1001,9 +1001,6 @@ typedef std::complex fcomplex; else if (strcmp(fname[ifield],"spread_kerpad") == 0) { oc->spread_kerpad = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); } - else if (strcmp(fname[ifield],"chkbnds") == 0) { - oc->chkbnds = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); - } else if (strcmp(fname[ifield],"fftw") == 0) { oc->fftw = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); } @@ -1134,7 +1131,7 @@ mxWrapCopyZDef_single (mxWrapCopy_single_dcomplex, dcomplex, mxWrapReturnZDef_single (mxWrapReturn_single_dcomplex, dcomplex, real_dcomplex, imag_dcomplex) -/* ---- finufft.mw: 169 ---- +/* ---- finufft.mw: 166 ---- * finufft_mex_setup(); */ static const char* stubids1_ = "finufft_mex_setup()"; @@ -1152,7 +1149,7 @@ void mexStub1(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 170 ---- +/* ---- finufft.mw: 167 ---- * finufft_opts* o = new(); */ static const char* stubids2_ = "o finufft_opts* = new()"; @@ -1173,7 +1170,7 @@ void mexStub2(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 172 ---- +/* ---- finufft.mw: 169 ---- * finufft_plan* p = new(); */ static const char* stubids3_ = "o finufft_plan* = new()"; @@ -1194,7 +1191,7 @@ void mexStub3(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 173 ---- +/* ---- finufft.mw: 170 ---- * finufft_default_opts(finufft_opts* o); */ static const char* stubids4_ = "finufft_default_opts(i finufft_opts*)"; @@ -1217,7 +1214,7 @@ void mexStub4(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 175 ---- +/* ---- finufft.mw: 172 ---- * finufftf_plan* p = new(); */ static const char* stubids5_ = "o finufftf_plan* = new()"; @@ -1238,7 +1235,7 @@ void mexStub5(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 176 ---- +/* ---- finufft.mw: 173 ---- * finufftf_default_opts(finufft_opts* o); */ static const char* stubids6_ = "finufftf_default_opts(i finufft_opts*)"; @@ -1261,7 +1258,7 @@ void mexStub6(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 187 ---- +/* ---- finufft.mw: 184 ---- * copy_finufft_opts(mxArray opts, finufft_opts* o); */ static const char* stubids7_ = "copy_finufft_opts(i mxArray, i finufft_opts*)"; @@ -1286,7 +1283,7 @@ void mexStub7(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 190 ---- +/* ---- finufft.mw: 187 ---- * int ier = finufft_makeplan(int type, int dim, int64_t[3] n_modes, int iflag, int n_trans, double tol, finufft_plan* plan, finufft_opts* o); */ static const char* stubids8_ = "o int = finufft_makeplan(i int, i int, i int64_t[x], i int, i int, i double, i finufft_plan*, i finufft_opts*)"; @@ -1371,7 +1368,7 @@ void mexStub8(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 193 ---- +/* ---- finufft.mw: 190 ---- * int ier = finufftf_makeplan(int type, int dim, int64_t[3] n_modes, int iflag, int n_trans, float tol, finufftf_plan* plan, finufft_opts* o); */ static const char* stubids9_ = "o int = finufftf_makeplan(i int, i int, i int64_t[x], i int, i int, i float, i finufftf_plan*, i finufft_opts*)"; @@ -1456,7 +1453,7 @@ void mexStub9(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 195 ---- +/* ---- finufft.mw: 192 ---- * delete(finufft_opts* o); */ static const char* stubids10_ = "delete(i finufft_opts*)"; @@ -1479,7 +1476,7 @@ void mexStub10(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 225 ---- +/* ---- finufft.mw: 222 ---- * int ier = finufft_setpts(finufft_plan plan, int64_t nj, double[] xj, double[] yj, double[] zj, int64_t nk, double[] s, double[] t, double[] u); */ static const char* stubids11_ = "o int = finufft_setpts(i finufft_plan, i int64_t, i double[], i double[], i double[], i int64_t, i double[], i double[], i double[])"; @@ -1600,7 +1597,7 @@ void mexStub11(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 227 ---- +/* ---- finufft.mw: 224 ---- * int ier = finufftf_setpts(finufftf_plan plan, int64_t nj, float[] xj, float[] yj, float[] zj, int64_t nk, float[] s, float[] t, float[] u); */ static const char* stubids12_ = "o int = finufftf_setpts(i finufftf_plan, i int64_t, i float[], i float[], i float[], i int64_t, i float[], i float[], i float[])"; @@ -1721,7 +1718,7 @@ void mexStub12(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 254 ---- +/* ---- finufft.mw: 251 ---- * int ier = finufft_execute(finufft_plan plan, dcomplex[] data_in, output dcomplex[ncoeffs] result); */ static const char* stubids13_ = "o int = finufft_execute(i finufft_plan, i dcomplex[], o dcomplex[x])"; @@ -1775,7 +1772,7 @@ void mexStub13(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 256 ---- +/* ---- finufft.mw: 253 ---- * int ier = finufftf_execute(finufftf_plan plan, fcomplex[] data_in, output fcomplex[ncoeffs] result); */ static const char* stubids14_ = "o int = finufftf_execute(i finufftf_plan, i fcomplex[], o fcomplex[x])"; @@ -1829,7 +1826,7 @@ void mexStub14(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 262 ---- +/* ---- finufft.mw: 259 ---- * int ier = finufft_execute(finufft_plan plan, output dcomplex[nj, n_trans] result, dcomplex[] data_in); */ static const char* stubids15_ = "o int = finufft_execute(i finufft_plan, o dcomplex[xx], i dcomplex[])"; @@ -1885,7 +1882,7 @@ void mexStub15(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 264 ---- +/* ---- finufft.mw: 261 ---- * int ier = finufftf_execute(finufftf_plan plan, output fcomplex[nj, n_trans] result, fcomplex[] data_in); */ static const char* stubids16_ = "o int = finufftf_execute(i finufftf_plan, o fcomplex[xx], i fcomplex[])"; @@ -1941,7 +1938,7 @@ void mexStub16(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 268 ---- +/* ---- finufft.mw: 265 ---- * int ier = finufft_execute(finufft_plan plan, dcomplex[] data_in, output dcomplex[nk, n_trans] result); */ static const char* stubids17_ = "o int = finufft_execute(i finufft_plan, i dcomplex[], o dcomplex[xx])"; @@ -1997,7 +1994,7 @@ void mexStub17(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 270 ---- +/* ---- finufft.mw: 267 ---- * int ier = finufftf_execute(finufftf_plan plan, fcomplex[] data_in, output fcomplex[nk, n_trans] result); */ static const char* stubids18_ = "o int = finufftf_execute(i finufftf_plan, i fcomplex[], o fcomplex[xx])"; @@ -2053,7 +2050,7 @@ void mexStub18(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 282 ---- +/* ---- finufft.mw: 279 ---- * finufft_destroy(finufft_plan plan); */ static const char* stubids19_ = "finufft_destroy(i finufft_plan)"; @@ -2080,7 +2077,7 @@ void mexStub19(int nlhs, mxArray* plhs[], mexErrMsgTxt(mw_err_txt_); } -/* ---- finufft.mw: 284 ---- +/* ---- finufft.mw: 281 ---- * finufftf_destroy(finufftf_plan plan); */ static const char* stubids20_ = "finufftf_destroy(i finufftf_plan)"; @@ -2175,26 +2172,26 @@ void mexFunction(int nlhs, mxArray* plhs[], } else if (strcmp(id, "*profile report*") == 0) { if (!mexprofrecord_) mexPrintf("Profiler inactive\n"); - mexPrintf("%d calls to finufft.mw:169\n", mexprofrecord_[1]); - mexPrintf("%d calls to finufft.mw:170\n", mexprofrecord_[2]); - mexPrintf("%d calls to finufft.mw:172\n", mexprofrecord_[3]); - mexPrintf("%d calls to finufft.mw:173\n", mexprofrecord_[4]); - mexPrintf("%d calls to finufft.mw:175\n", mexprofrecord_[5]); - mexPrintf("%d calls to finufft.mw:176\n", mexprofrecord_[6]); - mexPrintf("%d calls to finufft.mw:187\n", mexprofrecord_[7]); - mexPrintf("%d calls to finufft.mw:190\n", mexprofrecord_[8]); - mexPrintf("%d calls to finufft.mw:193\n", mexprofrecord_[9]); - mexPrintf("%d calls to finufft.mw:195\n", mexprofrecord_[10]); - mexPrintf("%d calls to finufft.mw:225\n", mexprofrecord_[11]); - mexPrintf("%d calls to finufft.mw:227\n", mexprofrecord_[12]); - mexPrintf("%d calls to finufft.mw:254\n", mexprofrecord_[13]); - mexPrintf("%d calls to finufft.mw:256\n", mexprofrecord_[14]); - mexPrintf("%d calls to finufft.mw:262\n", mexprofrecord_[15]); - mexPrintf("%d calls to finufft.mw:264\n", mexprofrecord_[16]); - mexPrintf("%d calls to finufft.mw:268\n", mexprofrecord_[17]); - mexPrintf("%d calls to finufft.mw:270\n", mexprofrecord_[18]); - mexPrintf("%d calls to finufft.mw:282\n", mexprofrecord_[19]); - mexPrintf("%d calls to finufft.mw:284\n", mexprofrecord_[20]); + mexPrintf("%d calls to finufft.mw:166\n", mexprofrecord_[1]); + mexPrintf("%d calls to finufft.mw:167\n", mexprofrecord_[2]); + mexPrintf("%d calls to finufft.mw:169\n", mexprofrecord_[3]); + mexPrintf("%d calls to finufft.mw:170\n", mexprofrecord_[4]); + mexPrintf("%d calls to finufft.mw:172\n", mexprofrecord_[5]); + mexPrintf("%d calls to finufft.mw:173\n", mexprofrecord_[6]); + mexPrintf("%d calls to finufft.mw:184\n", mexprofrecord_[7]); + mexPrintf("%d calls to finufft.mw:187\n", mexprofrecord_[8]); + mexPrintf("%d calls to finufft.mw:190\n", mexprofrecord_[9]); + mexPrintf("%d calls to finufft.mw:192\n", mexprofrecord_[10]); + mexPrintf("%d calls to finufft.mw:222\n", mexprofrecord_[11]); + mexPrintf("%d calls to finufft.mw:224\n", mexprofrecord_[12]); + mexPrintf("%d calls to finufft.mw:251\n", mexprofrecord_[13]); + mexPrintf("%d calls to finufft.mw:253\n", mexprofrecord_[14]); + mexPrintf("%d calls to finufft.mw:259\n", mexprofrecord_[15]); + mexPrintf("%d calls to finufft.mw:261\n", mexprofrecord_[16]); + mexPrintf("%d calls to finufft.mw:265\n", mexprofrecord_[17]); + mexPrintf("%d calls to finufft.mw:267\n", mexprofrecord_[18]); + mexPrintf("%d calls to finufft.mw:279\n", mexprofrecord_[19]); + mexPrintf("%d calls to finufft.mw:281\n", mexprofrecord_[20]); } else if (strcmp(id, "*profile log*") == 0) { FILE* logfp; if (nrhs != 2 || mxGetString(prhs[1], id, sizeof(id)) != 0) @@ -2204,26 +2201,26 @@ void mexFunction(int nlhs, mxArray* plhs[], mexErrMsgTxt("Cannot open log for output"); if (!mexprofrecord_) fprintf(logfp, "Profiler inactive\n"); - fprintf(logfp, "%d calls to finufft.mw:169\n", mexprofrecord_[1]); - fprintf(logfp, "%d calls to finufft.mw:170\n", mexprofrecord_[2]); - fprintf(logfp, "%d calls to finufft.mw:172\n", mexprofrecord_[3]); - fprintf(logfp, "%d calls to finufft.mw:173\n", mexprofrecord_[4]); - fprintf(logfp, "%d calls to finufft.mw:175\n", mexprofrecord_[5]); - fprintf(logfp, "%d calls to finufft.mw:176\n", mexprofrecord_[6]); - fprintf(logfp, "%d calls to finufft.mw:187\n", mexprofrecord_[7]); - fprintf(logfp, "%d calls to finufft.mw:190\n", mexprofrecord_[8]); - fprintf(logfp, "%d calls to finufft.mw:193\n", mexprofrecord_[9]); - fprintf(logfp, "%d calls to finufft.mw:195\n", mexprofrecord_[10]); - fprintf(logfp, "%d calls to finufft.mw:225\n", mexprofrecord_[11]); - fprintf(logfp, "%d calls to finufft.mw:227\n", mexprofrecord_[12]); - fprintf(logfp, "%d calls to finufft.mw:254\n", mexprofrecord_[13]); - fprintf(logfp, "%d calls to finufft.mw:256\n", mexprofrecord_[14]); - fprintf(logfp, "%d calls to finufft.mw:262\n", mexprofrecord_[15]); - fprintf(logfp, "%d calls to finufft.mw:264\n", mexprofrecord_[16]); - fprintf(logfp, "%d calls to finufft.mw:268\n", mexprofrecord_[17]); - fprintf(logfp, "%d calls to finufft.mw:270\n", mexprofrecord_[18]); - fprintf(logfp, "%d calls to finufft.mw:282\n", mexprofrecord_[19]); - fprintf(logfp, "%d calls to finufft.mw:284\n", mexprofrecord_[20]); + fprintf(logfp, "%d calls to finufft.mw:166\n", mexprofrecord_[1]); + fprintf(logfp, "%d calls to finufft.mw:167\n", mexprofrecord_[2]); + fprintf(logfp, "%d calls to finufft.mw:169\n", mexprofrecord_[3]); + fprintf(logfp, "%d calls to finufft.mw:170\n", mexprofrecord_[4]); + fprintf(logfp, "%d calls to finufft.mw:172\n", mexprofrecord_[5]); + fprintf(logfp, "%d calls to finufft.mw:173\n", mexprofrecord_[6]); + fprintf(logfp, "%d calls to finufft.mw:184\n", mexprofrecord_[7]); + fprintf(logfp, "%d calls to finufft.mw:187\n", mexprofrecord_[8]); + fprintf(logfp, "%d calls to finufft.mw:190\n", mexprofrecord_[9]); + fprintf(logfp, "%d calls to finufft.mw:192\n", mexprofrecord_[10]); + fprintf(logfp, "%d calls to finufft.mw:222\n", mexprofrecord_[11]); + fprintf(logfp, "%d calls to finufft.mw:224\n", mexprofrecord_[12]); + fprintf(logfp, "%d calls to finufft.mw:251\n", mexprofrecord_[13]); + fprintf(logfp, "%d calls to finufft.mw:253\n", mexprofrecord_[14]); + fprintf(logfp, "%d calls to finufft.mw:259\n", mexprofrecord_[15]); + fprintf(logfp, "%d calls to finufft.mw:261\n", mexprofrecord_[16]); + fprintf(logfp, "%d calls to finufft.mw:265\n", mexprofrecord_[17]); + fprintf(logfp, "%d calls to finufft.mw:267\n", mexprofrecord_[18]); + fprintf(logfp, "%d calls to finufft.mw:279\n", mexprofrecord_[19]); + fprintf(logfp, "%d calls to finufft.mw:281\n", mexprofrecord_[20]); fclose(logfp); } else mexErrMsgTxt("Unknown identifier"); diff --git a/matlab/finufft.mw b/matlab/finufft.mw index 2e7a3a391..4758157a1 100644 --- a/matlab/finufft.mw +++ b/matlab/finufft.mw @@ -78,9 +78,6 @@ $ } $ else if (strcmp(fname[ifield],"spread_kerpad") == 0) { $ oc->spread_kerpad = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); $ } -$ else if (strcmp(fname[ifield],"chkbnds") == 0) { -$ oc->chkbnds = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); -$ } $ else if (strcmp(fname[ifield],"fftw") == 0) { $ oc->fftw = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield))); $ } diff --git a/matlab/finufft_plan.m b/matlab/finufft_plan.m index 24c728ec4..141cd8ecc 100644 --- a/matlab/finufft_plan.m +++ b/matlab/finufft_plan.m @@ -1,155 +1,3 @@ -% FINUFFT_PLAN is a class which wraps the guru interface to FINUFFT. -% -% Full documentation is given in ../finufft-manual.pdf and online at -% http://finufft.readthedocs.io -% Also see examples in the matlab/examples and matlab/test directories. -% -% PROPERTIES -% mwptr - opaque pointer to a C++ finufft_plan object (see MWrap manual), -% whose properties cannot be accessed directly -% floatprec - either 'double' or 'single', tracks what precision of C++ -% library is being called -% type, dim, n_modes, n_trans, nj, nk - other plan parameters -% Note: the user should never alter these plan properties directly! Rather, -% the below methods should be used to create, use, and destroy plans. -% -% METHODS -% finufft_plan - create guru plan object for one/many general nonuniform FFTs. -% setpts - process nonuniform points for general FINUFFT transform(s). -% execute - execute single or many-vector FINUFFT transforms in a plan. -% -% General notes: -% * use delete(plan) to remove a plan after use. -% * See ERRHANDLER, VALID_*, and this code for warning/error IDs. -% -% -% -% =========== Detailed description of guru methods ========================== -% -% 1) FINUFFT_PLAN create guru plan object for one/many general nonuniform FFTs. -% -% plan = finufft_plan(type, n_modes_or_dim, isign, ntrans, eps) -% plan = finufft_plan(type, n_modes_or_dim, isign, ntrans, eps, opts) -% -% Creates a finufft_plan MATLAB object in the guru interface to FINUFFT, of -% type 1, 2 or 3, and with given numbers of Fourier modes (unless type 3). -% -% Inputs: -% type transform type: 1, 2, or 3 -% n_modes_or_dim if type is 1 or 2, the number of Fourier modes in each -% dimension: [ms] in 1D, [ms mt] in 2D, or [ms mt mu] in 3D. -% Its length sets the dimension, which must be 1, 2 or 3. -% If type is 3, in contrast, its *value* fixes the dimension -% isign if >=0, uses + sign in exponential, otherwise - sign. -% eps relative precision requested (generally between 1e-15 and 1e-1) -% opts optional struct with optional fields controlling the following: -% opts.debug: 0 (silent, default), 1 (timing breakdown), 2 (debug info). -% opts.spread_debug: spreader: 0 (no text, default), 1 (some), or 2 (lots) -% opts.spread_sort: 0 (don't sort NU pts), 1 (do), 2 (auto, default) -% opts.spread_kerevalmeth: 0: exp(sqrt()), 1: Horner ppval (faster) -% opts.spread_kerpad: (iff kerevalmeth=0) 0: don't pad to mult of 4, 1: do -% opts.fftw: FFTW plan mode, 64=FFTW_ESTIMATE (default), 0=FFTW_MEASURE, etc -% opts.upsampfac: sigma. 2.0 (default), or 1.25 (low RAM, smaller FFT) -% opts.spread_thread: for ntrans>1 only. 0:auto, 1:seq multi, 2:par, etc -% opts.maxbatchsize: for ntrans>1 only. max blocking size, or 0 for auto. -% opts.nthreads: number of threads, or 0: use all available (default) -% opts.floatprec: library precision to use, 'double' (default) or 'single'. -% for type 1 and 2 only, the following opts fields are also relevant: -% opts.modeord: 0 (CMCL increasing mode ordering, default), 1 (FFT ordering) -% opts.chkbnds: [DEPRECATED] has no effect -% Outputs: -% plan finufft_plan object (opaque pointer) -% -% Notes: -% * For type 1 and 2, this does the FFTW planning and kernel-FT precomputation. -% * For type 3, this does very little, since the FFT sizes are not yet known. -% * Be default all threads are planned; control how many with opts.nthreads. -% * The vectorized (many vector) plan, ie ntrans>1, can be much faster -% than repeated calls with the same nonuniform points. Note that here the I/O -% data ordering is stacked rather than interleaved. See ../docs/matlab.rst -% * For more details about the opts fields, see ../docs/opts.rst -% -% -% 2) SETPTS process nonuniform points for general FINUFFT transform(s). -% -% plan.setpts(xj) -% plan.setpts(xj, yj) -% plan.setpts(xj, yj, zj) -% plan.setpts(xj, [], [], s) -% plan.setpts(xj, yj, [], s, t) -% plan.setpts(xj, yj, zj, s, t, u) -% -% When plan is a finufft_plan MATLAB object, brings in nonuniform point -% coordinates (xj,yj,zj), and additionally in the type 3 case, nonuniform -% frequency target points (s,t,u). Empty arrays may be passed in the case of -% unused dimensions. For all types, sorting is done to internally store a -% reindexing of points, and for type 3 the spreading and FFTs are planned. -% The nonuniform points may be used for multiple transforms. -% -% Inputs: -% xj vector of x-coords of all nonuniform points -% yj empty (if dim<2), or vector of y-coords of all nonuniform points -% zj empty (if dim<3), or vector of z-coords of all nonuniform points -% s vector of x-coords of all nonuniform frequency targets -% t empty (if dim<2), or vector of y-coords of all frequency targets -% u empty (if dim<3), or vector of z-coords of all frequency targets -% Input/Outputs: -% plan finufft_plan object -% -% Notes: -% * The values in xj (and if nonempty, yj and zj) are real-valued, and -% invariant under translations by multiples of 2pi. For type 1 -% they are "sources", whereas for type 2 they are "targets". -% For type 3 there is no periodicity, and no restrictions other -% than the resulting size of the internal fine grids. -% * s (and t and u) are only relevant for type 3, and may be omitted otherwise -% * The matlab vectors xj,... and s,... should not be changed before calling -% future execute calls, because the plan stores only pointers to the -% arrays (they are not duplicated internally). -% * The precision (double/single) of all inputs must match that chosen at the -% plan stage using opts.floatprec, otherwise an error is raised. -% -% -% 3) EXECUTE execute single or many-vector FINUFFT transforms in a plan. -% -% result = plan.execute(data_in); -% -% For plan a previously created finufft_plan object also containing all -% needed nonuniform point coordinates, do a single (or if ntrans>1 in the -% plan stage, multiple) NUFFT transform(s), with the strengths or Fourier -% coefficient inputs vector(s) from data_in. The result of the transform(s) -% is returned as a (possibly multidimensional) array. -% -% Inputs: -% plan finufft_plan object -% data_in strengths (types 1 or 3) or Fourier coefficients (type 2) -% vector, matrix, or array of appropriate size. For type 1 and 3, -% this is either a length-M vector (where M is the length of xj), -% or an (M,ntrans) matrix when ntrans>1. For type 2, in 1D this is -% length-ms, in 2D size (ms,mt), or in 3D size (ms,mt,mu), or -% each of these with an extra last dimension ntrans if ntrans>1. -% Outputs: -% result vector of output strengths at targets (types 2 or 3), or array -% of Fourier coefficients (type 1), or, if ntrans>1, a stack of -% such vectors or arrays, of appropriate size. -% Specifically, if ntrans=1, for type 1, in 1D -% this is a length-ms column vector, in 2D a matrix of size -% (ms,mt), or in 3D an array of size (ms,mt,mu); for types 2 and 3 -% it is a column vector of length M (the length of xj in type 2), -% or nk (the length of s in type 3). If ntrans>1 its is a stack -% of such objects, ie, it has an extra last dimension ntrans. -% -% Notes: -% * The precision (double/single) of all inputs must match that chosen at the -% plan stage using opts.floatprec, otherwise an error is raised. -% -% -% 4) To deallocate (delete) a nonuniform FFT plan, use delete(plan) -% -% This deallocates all stored FFTW plans, nonuniform point sorting arrays, -% kernel Fourier transforms arrays, etc. -% -% classdef finufft_plan < handle diff --git a/matlab/test/check_finufft.m b/matlab/test/check_finufft.m index 4d4a1f75c..e183ec685 100644 --- a/matlab/test/check_finufft.m +++ b/matlab/test/check_finufft.m @@ -11,6 +11,7 @@ isign = +1; % sign of imaginary unit in exponential eps = 1e-6; % requested accuracy o.debug = 0; % choose 1 for timing breakdown text output +o.chkbnds = 0; %o.spread_debug=1; % see detailed spreader info FFTW_ESTIMATE = bitshift(1,6); o.fftw = FFTW_ESTIMATE; % or see fftw3.h o.upsampfac=0; % 0 (auto), 2.0 (default), or 1.25 (low-RAM, small-FFT) diff --git a/src/finufft.cpp b/src/finufft.cpp index 0e2eb6f35..5b33ef126 100644 --- a/src/finufft.cpp +++ b/src/finufft.cpp @@ -136,13 +136,8 @@ int setup_spreader_for_nufft(finufft_spread_opts &spopts, FLT eps, finufft_opts spopts.atomic_threshold = opts.spread_nthr_atomic; if (opts.spread_max_sp_size>0) // overrides spopts.max_subproblem_size = opts.spread_max_sp_size; - if (opts.chkbnds != 1) { - fprintf(stderr, "chkbnds options is deprecated, please use the default value\n"); - // if other error occurred before this, return that error otherwise return a warning - if (!ier) { - return FINUFFT_WARN_CHKBND_NOT_DEFAULT; - } - } + if (opts.chkbnds != 1) // deprecated default value hardcoded here + fprintf(stderr, "[%s] opts.chkbnds is deprecated; ignoring change from default value.\n",__func__); return ier; }