Skip to content

Commit b166283

Browse files
committed
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
1 parent 4cf52e7 commit b166283

File tree

6 files changed

+64
-227
lines changed

6 files changed

+64
-227
lines changed

include/finufft_errors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
#define FINUFFT_ERR_BINSIZE_NOTVALID 18
2424
#define FINUFFT_ERR_INSUFFICIENT_SHMEM 19
2525
#define FINUFFT_ERR_NUM_NU_PTS_INVALID 20
26-
#define FINUFFT_WARN_CHKBND_NOT_DEFAULT 21
2726
#endif

matlab/finufft.cpp

Lines changed: 61 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Automatically generated by mwrap */
33
/* --------------------------------------------------- */
44

5-
/* Code generated by mwrap 1.0 */
5+
/* Code generated by mwrap 1.1 */
66
/*
77
Copyright statement for mwrap:
88
@@ -1001,9 +1001,6 @@ typedef std::complex<float> fcomplex;
10011001
else if (strcmp(fname[ifield],"spread_kerpad") == 0) {
10021002
oc->spread_kerpad = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
10031003
}
1004-
else if (strcmp(fname[ifield],"chkbnds") == 0) {
1005-
oc->chkbnds = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
1006-
}
10071004
else if (strcmp(fname[ifield],"fftw") == 0) {
10081005
oc->fftw = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
10091006
}
@@ -1134,7 +1131,7 @@ mxWrapCopyZDef_single (mxWrapCopy_single_dcomplex, dcomplex,
11341131
mxWrapReturnZDef_single (mxWrapReturn_single_dcomplex, dcomplex,
11351132
real_dcomplex, imag_dcomplex)
11361133

1137-
/* ---- finufft.mw: 169 ----
1134+
/* ---- finufft.mw: 166 ----
11381135
* finufft_mex_setup();
11391136
*/
11401137
static const char* stubids1_ = "finufft_mex_setup()";
@@ -1152,7 +1149,7 @@ void mexStub1(int nlhs, mxArray* plhs[],
11521149
mexErrMsgTxt(mw_err_txt_);
11531150
}
11541151

1155-
/* ---- finufft.mw: 170 ----
1152+
/* ---- finufft.mw: 167 ----
11561153
* finufft_opts* o = new();
11571154
*/
11581155
static const char* stubids2_ = "o finufft_opts* = new()";
@@ -1173,7 +1170,7 @@ void mexStub2(int nlhs, mxArray* plhs[],
11731170
mexErrMsgTxt(mw_err_txt_);
11741171
}
11751172

1176-
/* ---- finufft.mw: 172 ----
1173+
/* ---- finufft.mw: 169 ----
11771174
* finufft_plan* p = new();
11781175
*/
11791176
static const char* stubids3_ = "o finufft_plan* = new()";
@@ -1194,7 +1191,7 @@ void mexStub3(int nlhs, mxArray* plhs[],
11941191
mexErrMsgTxt(mw_err_txt_);
11951192
}
11961193

1197-
/* ---- finufft.mw: 173 ----
1194+
/* ---- finufft.mw: 170 ----
11981195
* finufft_default_opts(finufft_opts* o);
11991196
*/
12001197
static const char* stubids4_ = "finufft_default_opts(i finufft_opts*)";
@@ -1217,7 +1214,7 @@ void mexStub4(int nlhs, mxArray* plhs[],
12171214
mexErrMsgTxt(mw_err_txt_);
12181215
}
12191216

1220-
/* ---- finufft.mw: 175 ----
1217+
/* ---- finufft.mw: 172 ----
12211218
* finufftf_plan* p = new();
12221219
*/
12231220
static const char* stubids5_ = "o finufftf_plan* = new()";
@@ -1238,7 +1235,7 @@ void mexStub5(int nlhs, mxArray* plhs[],
12381235
mexErrMsgTxt(mw_err_txt_);
12391236
}
12401237

1241-
/* ---- finufft.mw: 176 ----
1238+
/* ---- finufft.mw: 173 ----
12421239
* finufftf_default_opts(finufft_opts* o);
12431240
*/
12441241
static const char* stubids6_ = "finufftf_default_opts(i finufft_opts*)";
@@ -1261,7 +1258,7 @@ void mexStub6(int nlhs, mxArray* plhs[],
12611258
mexErrMsgTxt(mw_err_txt_);
12621259
}
12631260

1264-
/* ---- finufft.mw: 187 ----
1261+
/* ---- finufft.mw: 184 ----
12651262
* copy_finufft_opts(mxArray opts, finufft_opts* o);
12661263
*/
12671264
static const char* stubids7_ = "copy_finufft_opts(i mxArray, i finufft_opts*)";
@@ -1286,7 +1283,7 @@ void mexStub7(int nlhs, mxArray* plhs[],
12861283
mexErrMsgTxt(mw_err_txt_);
12871284
}
12881285

1289-
/* ---- finufft.mw: 190 ----
1286+
/* ---- finufft.mw: 187 ----
12901287
* 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);
12911288
*/
12921289
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[],
13711368
mexErrMsgTxt(mw_err_txt_);
13721369
}
13731370

1374-
/* ---- finufft.mw: 193 ----
1371+
/* ---- finufft.mw: 190 ----
13751372
* 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);
13761373
*/
13771374
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[],
14561453
mexErrMsgTxt(mw_err_txt_);
14571454
}
14581455

1459-
/* ---- finufft.mw: 195 ----
1456+
/* ---- finufft.mw: 192 ----
14601457
* delete(finufft_opts* o);
14611458
*/
14621459
static const char* stubids10_ = "delete(i finufft_opts*)";
@@ -1479,7 +1476,7 @@ void mexStub10(int nlhs, mxArray* plhs[],
14791476
mexErrMsgTxt(mw_err_txt_);
14801477
}
14811478

1482-
/* ---- finufft.mw: 225 ----
1479+
/* ---- finufft.mw: 222 ----
14831480
* 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);
14841481
*/
14851482
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[],
16001597
mexErrMsgTxt(mw_err_txt_);
16011598
}
16021599

1603-
/* ---- finufft.mw: 227 ----
1600+
/* ---- finufft.mw: 224 ----
16041601
* 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);
16051602
*/
16061603
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[],
17211718
mexErrMsgTxt(mw_err_txt_);
17221719
}
17231720

1724-
/* ---- finufft.mw: 254 ----
1721+
/* ---- finufft.mw: 251 ----
17251722
* int ier = finufft_execute(finufft_plan plan, dcomplex[] data_in, output dcomplex[ncoeffs] result);
17261723
*/
17271724
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[],
17751772
mexErrMsgTxt(mw_err_txt_);
17761773
}
17771774

1778-
/* ---- finufft.mw: 256 ----
1775+
/* ---- finufft.mw: 253 ----
17791776
* int ier = finufftf_execute(finufftf_plan plan, fcomplex[] data_in, output fcomplex[ncoeffs] result);
17801777
*/
17811778
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[],
18291826
mexErrMsgTxt(mw_err_txt_);
18301827
}
18311828

1832-
/* ---- finufft.mw: 262 ----
1829+
/* ---- finufft.mw: 259 ----
18331830
* int ier = finufft_execute(finufft_plan plan, output dcomplex[nj, n_trans] result, dcomplex[] data_in);
18341831
*/
18351832
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[],
18851882
mexErrMsgTxt(mw_err_txt_);
18861883
}
18871884

1888-
/* ---- finufft.mw: 264 ----
1885+
/* ---- finufft.mw: 261 ----
18891886
* int ier = finufftf_execute(finufftf_plan plan, output fcomplex[nj, n_trans] result, fcomplex[] data_in);
18901887
*/
18911888
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[],
19411938
mexErrMsgTxt(mw_err_txt_);
19421939
}
19431940

1944-
/* ---- finufft.mw: 268 ----
1941+
/* ---- finufft.mw: 265 ----
19451942
* int ier = finufft_execute(finufft_plan plan, dcomplex[] data_in, output dcomplex[nk, n_trans] result);
19461943
*/
19471944
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[],
19971994
mexErrMsgTxt(mw_err_txt_);
19981995
}
19991996

2000-
/* ---- finufft.mw: 270 ----
1997+
/* ---- finufft.mw: 267 ----
20011998
* int ier = finufftf_execute(finufftf_plan plan, fcomplex[] data_in, output fcomplex[nk, n_trans] result);
20021999
*/
20032000
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[],
20532050
mexErrMsgTxt(mw_err_txt_);
20542051
}
20552052

2056-
/* ---- finufft.mw: 282 ----
2053+
/* ---- finufft.mw: 279 ----
20572054
* finufft_destroy(finufft_plan plan);
20582055
*/
20592056
static const char* stubids19_ = "finufft_destroy(i finufft_plan)";
@@ -2080,7 +2077,7 @@ void mexStub19(int nlhs, mxArray* plhs[],
20802077
mexErrMsgTxt(mw_err_txt_);
20812078
}
20822079

2083-
/* ---- finufft.mw: 284 ----
2080+
/* ---- finufft.mw: 281 ----
20842081
* finufftf_destroy(finufftf_plan plan);
20852082
*/
20862083
static const char* stubids20_ = "finufftf_destroy(i finufftf_plan)";
@@ -2175,26 +2172,26 @@ void mexFunction(int nlhs, mxArray* plhs[],
21752172
} else if (strcmp(id, "*profile report*") == 0) {
21762173
if (!mexprofrecord_)
21772174
mexPrintf("Profiler inactive\n");
2178-
mexPrintf("%d calls to finufft.mw:169\n", mexprofrecord_[1]);
2179-
mexPrintf("%d calls to finufft.mw:170\n", mexprofrecord_[2]);
2180-
mexPrintf("%d calls to finufft.mw:172\n", mexprofrecord_[3]);
2181-
mexPrintf("%d calls to finufft.mw:173\n", mexprofrecord_[4]);
2182-
mexPrintf("%d calls to finufft.mw:175\n", mexprofrecord_[5]);
2183-
mexPrintf("%d calls to finufft.mw:176\n", mexprofrecord_[6]);
2184-
mexPrintf("%d calls to finufft.mw:187\n", mexprofrecord_[7]);
2185-
mexPrintf("%d calls to finufft.mw:190\n", mexprofrecord_[8]);
2186-
mexPrintf("%d calls to finufft.mw:193\n", mexprofrecord_[9]);
2187-
mexPrintf("%d calls to finufft.mw:195\n", mexprofrecord_[10]);
2188-
mexPrintf("%d calls to finufft.mw:225\n", mexprofrecord_[11]);
2189-
mexPrintf("%d calls to finufft.mw:227\n", mexprofrecord_[12]);
2190-
mexPrintf("%d calls to finufft.mw:254\n", mexprofrecord_[13]);
2191-
mexPrintf("%d calls to finufft.mw:256\n", mexprofrecord_[14]);
2192-
mexPrintf("%d calls to finufft.mw:262\n", mexprofrecord_[15]);
2193-
mexPrintf("%d calls to finufft.mw:264\n", mexprofrecord_[16]);
2194-
mexPrintf("%d calls to finufft.mw:268\n", mexprofrecord_[17]);
2195-
mexPrintf("%d calls to finufft.mw:270\n", mexprofrecord_[18]);
2196-
mexPrintf("%d calls to finufft.mw:282\n", mexprofrecord_[19]);
2197-
mexPrintf("%d calls to finufft.mw:284\n", mexprofrecord_[20]);
2175+
mexPrintf("%d calls to finufft.mw:166\n", mexprofrecord_[1]);
2176+
mexPrintf("%d calls to finufft.mw:167\n", mexprofrecord_[2]);
2177+
mexPrintf("%d calls to finufft.mw:169\n", mexprofrecord_[3]);
2178+
mexPrintf("%d calls to finufft.mw:170\n", mexprofrecord_[4]);
2179+
mexPrintf("%d calls to finufft.mw:172\n", mexprofrecord_[5]);
2180+
mexPrintf("%d calls to finufft.mw:173\n", mexprofrecord_[6]);
2181+
mexPrintf("%d calls to finufft.mw:184\n", mexprofrecord_[7]);
2182+
mexPrintf("%d calls to finufft.mw:187\n", mexprofrecord_[8]);
2183+
mexPrintf("%d calls to finufft.mw:190\n", mexprofrecord_[9]);
2184+
mexPrintf("%d calls to finufft.mw:192\n", mexprofrecord_[10]);
2185+
mexPrintf("%d calls to finufft.mw:222\n", mexprofrecord_[11]);
2186+
mexPrintf("%d calls to finufft.mw:224\n", mexprofrecord_[12]);
2187+
mexPrintf("%d calls to finufft.mw:251\n", mexprofrecord_[13]);
2188+
mexPrintf("%d calls to finufft.mw:253\n", mexprofrecord_[14]);
2189+
mexPrintf("%d calls to finufft.mw:259\n", mexprofrecord_[15]);
2190+
mexPrintf("%d calls to finufft.mw:261\n", mexprofrecord_[16]);
2191+
mexPrintf("%d calls to finufft.mw:265\n", mexprofrecord_[17]);
2192+
mexPrintf("%d calls to finufft.mw:267\n", mexprofrecord_[18]);
2193+
mexPrintf("%d calls to finufft.mw:279\n", mexprofrecord_[19]);
2194+
mexPrintf("%d calls to finufft.mw:281\n", mexprofrecord_[20]);
21982195
} else if (strcmp(id, "*profile log*") == 0) {
21992196
FILE* logfp;
22002197
if (nrhs != 2 || mxGetString(prhs[1], id, sizeof(id)) != 0)
@@ -2204,26 +2201,26 @@ void mexFunction(int nlhs, mxArray* plhs[],
22042201
mexErrMsgTxt("Cannot open log for output");
22052202
if (!mexprofrecord_)
22062203
fprintf(logfp, "Profiler inactive\n");
2207-
fprintf(logfp, "%d calls to finufft.mw:169\n", mexprofrecord_[1]);
2208-
fprintf(logfp, "%d calls to finufft.mw:170\n", mexprofrecord_[2]);
2209-
fprintf(logfp, "%d calls to finufft.mw:172\n", mexprofrecord_[3]);
2210-
fprintf(logfp, "%d calls to finufft.mw:173\n", mexprofrecord_[4]);
2211-
fprintf(logfp, "%d calls to finufft.mw:175\n", mexprofrecord_[5]);
2212-
fprintf(logfp, "%d calls to finufft.mw:176\n", mexprofrecord_[6]);
2213-
fprintf(logfp, "%d calls to finufft.mw:187\n", mexprofrecord_[7]);
2214-
fprintf(logfp, "%d calls to finufft.mw:190\n", mexprofrecord_[8]);
2215-
fprintf(logfp, "%d calls to finufft.mw:193\n", mexprofrecord_[9]);
2216-
fprintf(logfp, "%d calls to finufft.mw:195\n", mexprofrecord_[10]);
2217-
fprintf(logfp, "%d calls to finufft.mw:225\n", mexprofrecord_[11]);
2218-
fprintf(logfp, "%d calls to finufft.mw:227\n", mexprofrecord_[12]);
2219-
fprintf(logfp, "%d calls to finufft.mw:254\n", mexprofrecord_[13]);
2220-
fprintf(logfp, "%d calls to finufft.mw:256\n", mexprofrecord_[14]);
2221-
fprintf(logfp, "%d calls to finufft.mw:262\n", mexprofrecord_[15]);
2222-
fprintf(logfp, "%d calls to finufft.mw:264\n", mexprofrecord_[16]);
2223-
fprintf(logfp, "%d calls to finufft.mw:268\n", mexprofrecord_[17]);
2224-
fprintf(logfp, "%d calls to finufft.mw:270\n", mexprofrecord_[18]);
2225-
fprintf(logfp, "%d calls to finufft.mw:282\n", mexprofrecord_[19]);
2226-
fprintf(logfp, "%d calls to finufft.mw:284\n", mexprofrecord_[20]);
2204+
fprintf(logfp, "%d calls to finufft.mw:166\n", mexprofrecord_[1]);
2205+
fprintf(logfp, "%d calls to finufft.mw:167\n", mexprofrecord_[2]);
2206+
fprintf(logfp, "%d calls to finufft.mw:169\n", mexprofrecord_[3]);
2207+
fprintf(logfp, "%d calls to finufft.mw:170\n", mexprofrecord_[4]);
2208+
fprintf(logfp, "%d calls to finufft.mw:172\n", mexprofrecord_[5]);
2209+
fprintf(logfp, "%d calls to finufft.mw:173\n", mexprofrecord_[6]);
2210+
fprintf(logfp, "%d calls to finufft.mw:184\n", mexprofrecord_[7]);
2211+
fprintf(logfp, "%d calls to finufft.mw:187\n", mexprofrecord_[8]);
2212+
fprintf(logfp, "%d calls to finufft.mw:190\n", mexprofrecord_[9]);
2213+
fprintf(logfp, "%d calls to finufft.mw:192\n", mexprofrecord_[10]);
2214+
fprintf(logfp, "%d calls to finufft.mw:222\n", mexprofrecord_[11]);
2215+
fprintf(logfp, "%d calls to finufft.mw:224\n", mexprofrecord_[12]);
2216+
fprintf(logfp, "%d calls to finufft.mw:251\n", mexprofrecord_[13]);
2217+
fprintf(logfp, "%d calls to finufft.mw:253\n", mexprofrecord_[14]);
2218+
fprintf(logfp, "%d calls to finufft.mw:259\n", mexprofrecord_[15]);
2219+
fprintf(logfp, "%d calls to finufft.mw:261\n", mexprofrecord_[16]);
2220+
fprintf(logfp, "%d calls to finufft.mw:265\n", mexprofrecord_[17]);
2221+
fprintf(logfp, "%d calls to finufft.mw:267\n", mexprofrecord_[18]);
2222+
fprintf(logfp, "%d calls to finufft.mw:279\n", mexprofrecord_[19]);
2223+
fprintf(logfp, "%d calls to finufft.mw:281\n", mexprofrecord_[20]);
22272224
fclose(logfp);
22282225
} else
22292226
mexErrMsgTxt("Unknown identifier");

matlab/finufft.mw

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ $ }
7878
$ else if (strcmp(fname[ifield],"spread_kerpad") == 0) {
7979
$ oc->spread_kerpad = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
8080
$ }
81-
$ else if (strcmp(fname[ifield],"chkbnds") == 0) {
82-
$ oc->chkbnds = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
83-
$ }
8481
$ else if (strcmp(fname[ifield],"fftw") == 0) {
8582
$ oc->fftw = (int)round(*mxGetPr(mxGetFieldByNumber(om,idx,ifield)));
8683
$ }

0 commit comments

Comments
 (0)