Changeset 2224
- Timestamp:
- Oct 27, 2004, 2:22:53 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 7 edited
-
dataManip/psConstants.h (modified) (3 diffs)
-
dataManip/psFunctions.c (modified) (3 diffs)
-
dataManip/psStats.c (modified) (3 diffs)
-
math/psConstants.h (modified) (3 diffs)
-
math/psPolynomial.c (modified) (3 diffs)
-
math/psSpline.c (modified) (3 diffs)
-
math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psConstants.h
r2221 r2224 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-2 7 23:31:43 $8 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-28 00:22:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \ 33 33 if (NAME < 0) { \ 34 psError(__func__," %s is less than 0.", #NAME); \34 psError(__func__,"Error: %s is less than 0.", #NAME); \ 35 35 return(RVAL); \ 36 36 } … … 38 38 #define PS_INT_CHECK_POSITIVE(NAME, RVAL) \ 39 39 if (NAME < 1) { \ 40 psError(__func__,"%s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 40 psError(__func__,"Error: %s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 44 // Produce an error if ((NAME1 > NAME2) 44 45 #define PS_INT_COMPARE(NAME1, NAME2, RVAL) \ 45 if (NAME1 < NAME2) { \ 46 psError(__func__,"%s is less than %s (%d < %D).", #NAME1, #NAME2, NAME1, NAME2); \ 47 return(RVAL); \ 48 } 49 50 46 if (NAME1 > NAME2) { \ 47 psError(__func__,"Error: (%s > %s) (%d %d).", #NAME1, #NAME2, NAME1, NAME2); \ 48 return(RVAL); \ 49 } 50 51 52 // Produce an error if ((NAME1 > NAME2) 51 53 #define PS_FLOAT_COMPARE(NAME1, NAME2, RVAL) \ 52 if ((NAME1 - NAME2) < -FLT_EPSILON) { \ 53 psError(__func__,"%s is less than %s.", #NAME1, #NAME2); \ 54 return(RVAL); \ 55 } 56 57 54 if (NAME1 > NAME2) { \ 55 psError(__func__,"Error: (%s > %s) (%f %f)", #NAME1, #NAME2, NAME1, NAME2); \ 56 return(RVAL); \ 57 } 58 59 #define PS_FLOAT_CHECK_NON_EQUAL(NAME1, NAME2, RVAL) \ 60 if (fabs(NAME2 - NAME1) < FLT_EPSILON) { \ 61 psError(__func__,"Error: %s and %s are equal.", #NAME1, #NAME2); \ 62 return(RVAL); \ 63 } 58 64 59 65 /***************************************************************************** -
trunk/psLib/src/dataManip/psFunctions.c
r2221 r2224 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-10-2 7 23:31:43 $9 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-10-28 00:22:53 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1670 1670 PS_INT_CHECK_NON_NEGATIVE(numSplines, NULL); 1671 1671 PS_INT_CHECK_NON_NEGATIVE(order, NULL); 1672 PS_FLOAT_C OMPARE(max, min, NULL);1672 PS_FLOAT_CHECK_NON_EQUAL(max, min, NULL); 1673 1673 1674 1674 psSpline1D *tmp = NULL; … … 2124 2124 PS_PTR_CHECK_NULL(spline, NULL); 2125 2125 PS_VECTOR_CHECK_NULL(x, NULL); 2126 PS_VECTOR_CHECK_TYPE (x, PS_TYPE_F32, NULL);2126 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 2127 2127 2128 2128 psS32 i; -
trunk/psLib/src/dataManip/psStats.c
r2221 r2224 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-2 7 23:31:43 $11 * @version $Revision: 1.77 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-28 00:22:53 $ 13 13 n * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1487 1487 PS_VECTOR_CHECK_NULL(bounds, NULL); 1488 1488 PS_VECTOR_CHECK_TYPE(bounds, PS_TYPE_F32, NULL); 1489 PS_INT_COMPARE( bounds->n, 2, NULL);1489 PS_INT_COMPARE(2, bounds->n, NULL); 1490 1490 1491 1491 psHistogram* newHist = NULL; // The new histogram structure … … 1694 1694 1695 1695 if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) { 1696 PS_FLOAT_COMPARE(stats->m ax, stats->min, stats);1696 PS_FLOAT_COMPARE(stats->min, stats->max, stats); 1697 1697 } 1698 1698 -
trunk/psLib/src/math/psConstants.h
r2221 r2224 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-2 7 23:31:43 $8 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-28 00:22:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \ 33 33 if (NAME < 0) { \ 34 psError(__func__," %s is less than 0.", #NAME); \34 psError(__func__,"Error: %s is less than 0.", #NAME); \ 35 35 return(RVAL); \ 36 36 } … … 38 38 #define PS_INT_CHECK_POSITIVE(NAME, RVAL) \ 39 39 if (NAME < 1) { \ 40 psError(__func__,"%s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 40 psError(__func__,"Error: %s is 0 or less.", #NAME); \ 41 return(RVAL); \ 42 } 43 44 // Produce an error if ((NAME1 > NAME2) 44 45 #define PS_INT_COMPARE(NAME1, NAME2, RVAL) \ 45 if (NAME1 < NAME2) { \ 46 psError(__func__,"%s is less than %s (%d < %D).", #NAME1, #NAME2, NAME1, NAME2); \ 47 return(RVAL); \ 48 } 49 50 46 if (NAME1 > NAME2) { \ 47 psError(__func__,"Error: (%s > %s) (%d %d).", #NAME1, #NAME2, NAME1, NAME2); \ 48 return(RVAL); \ 49 } 50 51 52 // Produce an error if ((NAME1 > NAME2) 51 53 #define PS_FLOAT_COMPARE(NAME1, NAME2, RVAL) \ 52 if ((NAME1 - NAME2) < -FLT_EPSILON) { \ 53 psError(__func__,"%s is less than %s.", #NAME1, #NAME2); \ 54 return(RVAL); \ 55 } 56 57 54 if (NAME1 > NAME2) { \ 55 psError(__func__,"Error: (%s > %s) (%f %f)", #NAME1, #NAME2, NAME1, NAME2); \ 56 return(RVAL); \ 57 } 58 59 #define PS_FLOAT_CHECK_NON_EQUAL(NAME1, NAME2, RVAL) \ 60 if (fabs(NAME2 - NAME1) < FLT_EPSILON) { \ 61 psError(__func__,"Error: %s and %s are equal.", #NAME1, #NAME2); \ 62 return(RVAL); \ 63 } 58 64 59 65 /***************************************************************************** -
trunk/psLib/src/math/psPolynomial.c
r2221 r2224 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-10-2 7 23:31:43 $9 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-10-28 00:22:53 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1670 1670 PS_INT_CHECK_NON_NEGATIVE(numSplines, NULL); 1671 1671 PS_INT_CHECK_NON_NEGATIVE(order, NULL); 1672 PS_FLOAT_C OMPARE(max, min, NULL);1672 PS_FLOAT_CHECK_NON_EQUAL(max, min, NULL); 1673 1673 1674 1674 psSpline1D *tmp = NULL; … … 2124 2124 PS_PTR_CHECK_NULL(spline, NULL); 2125 2125 PS_VECTOR_CHECK_NULL(x, NULL); 2126 PS_VECTOR_CHECK_TYPE (x, PS_TYPE_F32, NULL);2126 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 2127 2127 2128 2128 psS32 i; -
trunk/psLib/src/math/psSpline.c
r2221 r2224 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-10-2 7 23:31:43 $9 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-10-28 00:22:53 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1670 1670 PS_INT_CHECK_NON_NEGATIVE(numSplines, NULL); 1671 1671 PS_INT_CHECK_NON_NEGATIVE(order, NULL); 1672 PS_FLOAT_C OMPARE(max, min, NULL);1672 PS_FLOAT_CHECK_NON_EQUAL(max, min, NULL); 1673 1673 1674 1674 psSpline1D *tmp = NULL; … … 2124 2124 PS_PTR_CHECK_NULL(spline, NULL); 2125 2125 PS_VECTOR_CHECK_NULL(x, NULL); 2126 PS_VECTOR_CHECK_TYPE (x, PS_TYPE_F32, NULL);2126 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 2127 2127 2128 2128 psS32 i; -
trunk/psLib/src/math/psStats.c
r2221 r2224 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-2 7 23:31:43 $11 * @version $Revision: 1.77 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-28 00:22:53 $ 13 13 n * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1487 1487 PS_VECTOR_CHECK_NULL(bounds, NULL); 1488 1488 PS_VECTOR_CHECK_TYPE(bounds, PS_TYPE_F32, NULL); 1489 PS_INT_COMPARE( bounds->n, 2, NULL);1489 PS_INT_COMPARE(2, bounds->n, NULL); 1490 1490 1491 1491 psHistogram* newHist = NULL; // The new histogram structure … … 1694 1694 1695 1695 if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) { 1696 PS_FLOAT_COMPARE(stats->m ax, stats->min, stats);1696 PS_FLOAT_COMPARE(stats->min, stats->max, stats); 1697 1697 } 1698 1698
Note:
See TracChangeset
for help on using the changeset viewer.
