Changeset 2343 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Nov 12, 2004, 9:50:34 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r2342 r2343 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.9 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-11-12 19: 36:07$11 * @version $Revision: 1.94 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-11-12 19:50:34 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 992 992 float getThisValue) 993 993 { 994 PS_POLY_CHECK_NULL(myPoly, NAN); 994 995 PS_FLOAT_COMPARE(rangeLow, rangeHigh, NAN); 996 // We ensure that the requested f(y) value, which is getThisValue, is 997 // falls within the range of y-values of the polynomial "myPoly" in the 998 // specified x-range (rangeLow:rangeHigh). 999 float fLo = psPolynomial1DEval(rangeLow, myPoly); 1000 float fHi = psPolynomial1DEval(rangeHigh, myPoly); 1001 if (!((fLo <= getThisValue) && (fHi >= getThisValue))) { 1002 psError(PS_ERR_UNKNOWN, 1003 true, 1004 psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE); 1005 return(NAN); 1006 } 1007 995 1008 psS32 numIterations = 0; 996 1009 float midpoint = 0.0; … … 1073 1086 // Determine the coefficients of the polynomial. 1074 1087 myPoly = psVectorFitPolynomial1D(myPoly, x, y, yErr); 1088 if (myPoly == NULL) { 1089 psError(PS_ERR_UNEXPECTED_NULL, 1090 false, 1091 psStats_STATS_FIT_QUADRATIC_POLYNOMIAL_1D_FIT); 1092 return(NAN); 1093 } 1075 1094 // Call p_ps1DPolyMedian(), which does a binary search on the 1076 1095 // polynomial, looking for the value x such that f(x) = yVal
Note:
See TracChangeset
for help on using the changeset viewer.
