/* GaussFit - A System for Least Squares and Robust Estimation Source Code Copyright (C) 1987 by William H. Jefferys, Michael J. Fitzpatrick and Barbara E. McArthur All Rights Reserved. */ /* sorting and related routines */ #include #include double *linebuf; static exchange(lp1,lp2) /* exchange two pointers */ double *lp1,*lp2; { register double temp; temp = *lp1; *lp1 = *lp2; *lp2 = temp; } static cmp(i,j) /* compare two values */ double i,j; { register double x; x = i-j; if (x<0) return -1; if (x>0) return 1; return 0; } static rquick(lo,hi) /* quicksort main routine */ int lo,hi; { int i,j; double pivline; if(loi && cmp(linebuf[j],pivline) >= 0;) j = j-1; if(i