possible bug in resample?
chyh1990 opened this issue · 1 comments
chyh1990 commented
in resample():
if(ybd[0]>4) for(; y<hn; y++) { B0[ybs[y]] += C[yas[y]] * ywts[y]; }
This function yields unpredictable result if the output buffer(B) is not initialized (to zero);
pdollar commented
If calling from Matlab via mexFunction() output array B is initialized via "mxCreateNumericArray" in line 151. mxCreateNumericArray initializes all elements to 0. So this should not be a problem as the output B will have all 0s to start. If calling in some other way, you should make sure to allocate B so that it has all 0 elements.