63 for (
size_t index=0; index<
itsNLevels; index++)
102 if (histIndex>=0 && histIndex<(
int)
itsNLevels)
110 int *histo, *hilow, *hihigh, *histot;
111 unsigned long lowsum, highsum,
sum;
112 double ftemp, mea, sig, sig1, med, dpix;
113 int i, n, lcut,hcut, nlevelsm1, pix;
115 int hilowIndex, hihighIndex;
119 double myMea, mySig, myDpix;
130 sig = 10.0*nlevelsm1;
134 for (n=100; n-- && (sig>=0.1) && (
fabs(sig/sig1-1.0)>
BACK_EPS);)
159 for (i=lcut; i<=hcut; i++)
163 lowsum += *(hilow++);
169 highsum += *(hihigh--);
174 sum += (pix = *(histot++));
175 mea += (dpix = (double)pix*i);
180 myDpix = (double)myPix*i;
186 med = hihigh>=histo?((hihigh-histo)+0.5+((
double)highsum-lowsum)/(2.0*(*hilow>*hihigh?*hilow:*hihigh))): 0.0;
203 sig = sig/
sum - mea*mea;
205 sig = sig>0.0?
sqrt(sig):0.0;
206 lcut = (ftemp=med-3.0*sig)>0.0 ?(
int)(ftemp>0.0?ftemp+0.5:ftemp-0.5):0;
207 hcut = (ftemp=med+3.0*sig)<nlevelsm1 ?(
int)(ftemp>0.0?ftemp+0.5:ftemp-0.5): nlevelsm1;
214 :(
fabs((mea-med)/sig)< 0.3 ?
228 int *histo, *hilow, *hihigh, *histot;
229 unsigned long lowsum, highsum,
sum;
230 double ftemp, mea, sig, sig1, med, dpix;
231 int i, n, lcut,hcut, nlevelsm1, pix;
239 sig = 10.0*nlevelsm1;
248 for (n=100; n-- && (sig>=0.1) && (
fabs(sig/sig1-1.0)>
BACK_EPS);)
251 sum = mea = sig = 0.0;
252 lowsum = highsum = 0;
253 histot = hilow = histo+lcut;
255 for (i=lcut; i<=hcut; i++)
258 lowsum += *(hilow++);
260 highsum += *(hihigh--);
261 sum += (pix = *(histot++));
262 mea += (dpix = (double)pix*i);
267 ((hihigh-histo)+0.5+((
double)highsum-lowsum)/(2.0*(*hilow>*hihigh?
273 sig = sig/
sum - mea*mea;
275 sig = sig>0.0?
sqrt(sig):0.0;
276 lcut = (ftemp=med-3.0*sig)>0.0 ?(
int)(ftemp>0.0?ftemp+0.5:ftemp-0.5):0;
277 hcut = (ftemp=med+3.0*sig)<nlevelsm1 ?(
int)(ftemp>0.0?ftemp+0.5:ftemp-0.5)
302 :(
fabs((mea-med)/sig)< 0.3 ?
#define QUANTIF_NMAXLEVELS
T sum(const NdArray< T > &array)