Skip to content
Snippets Groups Projects
Commit 5ae249f2 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

SoftThresholding/C++ function: added handling of empty array as threshold (for crappy/faulty usage)


Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@676 4c865b51-4357-4376-afb4-474e03ccb993
parent 701d64da
No related branches found
No related tags found
No related merge requests found
......@@ -32,10 +32,11 @@ void mexFunction( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] )
}
}
const double * const __restrict inData = mxGetPr(prhs[0]);
double * const __restrict outData = mxGetPr(prhs[1]);
soft_threshold<mwSize, double> thr(*mxGetPr(prhs[1]));
double threshold = 0;
if (mxGetNumberOfElements(prhs[1]) != 0) {
threshold = *mxGetPr(prhs[1]);
}
soft_threshold<mwSize, double> thr(threshold);
const mwSize numElems = mxGetNumberOfElements(prhs[0]);
if (copy) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment