Changeset 2343
- Timestamp:
- Nov 12, 2004, 9:50:34 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 7 edited
-
dataManip/psDataManipErrors.dat (modified) (1 diff)
-
dataManip/psDataManipErrors.h (modified) (2 diffs)
-
dataManip/psFunctions.c (modified) (9 diffs)
-
dataManip/psStats.c (modified) (3 diffs)
-
math/psPolynomial.c (modified) (9 diffs)
-
math/psSpline.c (modified) (9 diffs)
-
math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psDataManipErrors.dat
r2339 r2343 27 27 psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM Failed to sort input data. 28 28 psStats_STATS_VECTOR_BIN_DISECT_PROBLEM Failed to determine the bin number of a data element. 29 psStats_STATS_FIT_QUADRATIC_POLYNOMIAL_1D_FIT Failed to fit a 1-dimensional polynomial to the three specified data points. Returning NAN. 30 psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE The requested y-value does not fall with the specified range of x-values. Returning NAN. 29 31 # 30 32 psFunctions_INVALID_POLYNOMIAL_TYPE Unknown polynomial type 0x%x found. Evaluation failed. -
trunk/psLib/src/dataManip/psDataManipErrors.h
r2339 r2343 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-1 1 20:13:57$9 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-12 19:50:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 #define PS_ERRORTEXT_psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM "Failed to sort input data." 48 48 #define PS_ERRORTEXT_psStats_STATS_VECTOR_BIN_DISECT_PROBLEM "Failed to determine the bin number of a data element." 49 #define PS_ERRORTEXT_psStats_STATS_FIT_QUADRATIC_POLYNOMIAL_1D_FIT "Failed to fit a 1-dimensional polynomial to the three specified data points. Returning NAN." 50 #define PS_ERRORTEXT_psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE "The requested y-value does not fall with the specified range of x-values. Returning NAN." 49 51 #define PS_ERRORTEXT_psFunctions_INVALID_POLYNOMIAL_TYPE "Unknown polynomial type 0x%x found. Evaluation failed." 50 52 #define PS_ERRORTEXT_psFunctions_TYPE_NOT_SUPPORTED "Input psVector type, %s, is not supported." -
trunk/psLib/src/dataManip/psFunctions.c
r2338 r2343 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-1 1 19:32:20$9 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-12 19:50:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1169 1169 myPoly->type); 1170 1170 } 1171 return( 0.0);1171 return(NAN); 1172 1172 } 1173 1173 … … 1207 1207 myPoly->type); 1208 1208 } 1209 return( 0.0);1209 return(NAN); 1210 1210 } 1211 1211 … … 1260 1260 myPoly->type); 1261 1261 } 1262 return( 0.0);1262 return(NAN); 1263 1263 } 1264 1264 … … 1324 1324 myPoly->type); 1325 1325 } 1326 return( 0.0);1326 return(NAN); 1327 1327 } 1328 1328 … … 1564 1564 myPoly->type); 1565 1565 } 1566 return( 0.0);1566 return(NAN); 1567 1567 } 1568 1568 … … 1603 1603 myPoly->type); 1604 1604 } 1605 return( 0.0);1605 return(NAN); 1606 1606 } 1607 1607 … … 1657 1657 myPoly->type); 1658 1658 } 1659 return( 0.0);1659 return(NAN); 1660 1660 } 1661 1661 … … 1721 1721 myPoly->type); 1722 1722 } 1723 return( 0.0);1723 return(NAN); 1724 1724 } 1725 1725 -
trunk/psLib/src/dataManip/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 -
trunk/psLib/src/math/psPolynomial.c
r2338 r2343 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-1 1 19:32:20$9 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-12 19:50:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1169 1169 myPoly->type); 1170 1170 } 1171 return( 0.0);1171 return(NAN); 1172 1172 } 1173 1173 … … 1207 1207 myPoly->type); 1208 1208 } 1209 return( 0.0);1209 return(NAN); 1210 1210 } 1211 1211 … … 1260 1260 myPoly->type); 1261 1261 } 1262 return( 0.0);1262 return(NAN); 1263 1263 } 1264 1264 … … 1324 1324 myPoly->type); 1325 1325 } 1326 return( 0.0);1326 return(NAN); 1327 1327 } 1328 1328 … … 1564 1564 myPoly->type); 1565 1565 } 1566 return( 0.0);1566 return(NAN); 1567 1567 } 1568 1568 … … 1603 1603 myPoly->type); 1604 1604 } 1605 return( 0.0);1605 return(NAN); 1606 1606 } 1607 1607 … … 1657 1657 myPoly->type); 1658 1658 } 1659 return( 0.0);1659 return(NAN); 1660 1660 } 1661 1661 … … 1721 1721 myPoly->type); 1722 1722 } 1723 return( 0.0);1723 return(NAN); 1724 1724 } 1725 1725 -
trunk/psLib/src/math/psSpline.c
r2338 r2343 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-11-1 1 19:32:20$9 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-11-12 19:50:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1169 1169 myPoly->type); 1170 1170 } 1171 return( 0.0);1171 return(NAN); 1172 1172 } 1173 1173 … … 1207 1207 myPoly->type); 1208 1208 } 1209 return( 0.0);1209 return(NAN); 1210 1210 } 1211 1211 … … 1260 1260 myPoly->type); 1261 1261 } 1262 return( 0.0);1262 return(NAN); 1263 1263 } 1264 1264 … … 1324 1324 myPoly->type); 1325 1325 } 1326 return( 0.0);1326 return(NAN); 1327 1327 } 1328 1328 … … 1564 1564 myPoly->type); 1565 1565 } 1566 return( 0.0);1566 return(NAN); 1567 1567 } 1568 1568 … … 1603 1603 myPoly->type); 1604 1604 } 1605 return( 0.0);1605 return(NAN); 1606 1606 } 1607 1607 … … 1657 1657 myPoly->type); 1658 1658 } 1659 return( 0.0);1659 return(NAN); 1660 1660 } 1661 1661 … … 1721 1721 myPoly->type); 1722 1722 } 1723 return( 0.0);1723 return(NAN); 1724 1724 } 1725 1725 -
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.
