//============================================================================== // Function for calculation of histogram // input: // nPoints - number of points for processing // pfVext - array with data // fMin,fMax - histogram limits // nHistPoints - number of intervals in histogram // output: // pnHistogram - array with histogram // return: // number of points in the histogram //============================================================================== int CalcHistogram(int nPoints, double* pfVect, int nHistPoints, double fMin, double fMax, int* pnHistogram) { int i; int ii; int nCount = 0; double fDelta = (fMax - fMin) / (double) nHistPoints; // histogram array initializing for(i=0; i=0 && ii #include //============================================================================== // TEST of function CalcHistogram: //============================================================================== #define NPOINTS 10000 #define NHISTPOINTS 10 int main(int nArgs, char** ppArgs) { double dat[NPOINTS]; int hist[NHISTPOINTS]; int i; double fMin = 0., fMax = 1.; for(i=0; i