Changeset 2217 for trunk/psLib/src/math/psConstants.h
- Timestamp:
- Oct 27, 2004, 11:06:30 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psConstants.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psConstants.h
r2216 r2217 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-27 2 0:32:49$8 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 21:06:30 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 29 29 /***************************************************************************** 30 31 *****************************************************************************/ 32 #define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \ 33 if (NAME < 0) { \ 34 psError(__func__,"%s is less than 0.", #NAME); \ 35 return(RVAL); \ 36 } 37 38 39 40 /***************************************************************************** 30 41 Macros which take a generic psLib type and determine if it is NULL, or has 31 42 the wrong type. … … 48 59 PS_VECTOR macros: 49 60 *****************************************************************************/ 50 #define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \ 51 if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \ 52 psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \ 61 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) \ 62 if (NAME == NULL || NAME->data.V == NULL) { \ 63 psError(__func__,"Unallowable operation: psVector %s or its data is NULL.", #NAME); \ 64 return(RVAL); \ 65 } \ 66 67 #define PS_VECTOR_CHECK_EMPTY(NAME, RVAL) \ 68 if (NAME->n < 1) { \ 69 psError(__func__,"Unallowable operation: psVector %s has no elements.", #NAME); \ 70 return(RVAL); \ 71 } \ 72 73 #define PS_VECTOR_CHECK_TYPE_F32_OR_F64(NAME, RVAL) \ 74 if ((NAME->type.type != PS_TYPE_F32) && (NAME->type.type != PS_TYPE_F64)) { \ 75 psAbort(__func__, "psVector %s: bad type(%d)", #NAME, NAME->type.type); \ 53 76 return(RVAL); \ 54 77 } \ … … 56 79 #define PS_VECTOR_CHECK_TYPE(NAME, TYPE, RVAL) \ 57 80 if (NAME->type.type != TYPE) { \ 58 psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \ 59 return(RVAL); \ 60 } 61 62 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) \ 63 if (NAME == NULL || NAME->data.V == NULL) { \ 64 psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME); \ 65 return(RVAL); \ 66 } \ 67 68 #define PS_VECTOR_CHECK_EMPTY(NAME, RVAL) \ 69 if (NAME->n < 1) { \ 70 psError(__func__,"Unallowable operation: %s has zero n value.", #NAME); \ 71 return(RVAL); \ 72 } \ 81 psError(__func__,"Unallowable operation: psVector %s has incorrect type.", #NAME); \ 82 return(RVAL); \ 83 } 73 84 74 85 #define PS_VECTOR_CHECK_SIZE_EQUAL(VEC1, VEC2, RVAL) \ 75 86 if (VEC1->n != VEC2->n) { \ 76 psError(__func__," Vector %s has size %d,Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \87 psError(__func__,"psVector %s has size %d, psVector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \ 77 88 return(RVAL); \ 78 89 } … … 166 177 PS_POLY macros: 167 178 *****************************************************************************/ 168 #define PS_POLY_CHECK_NULL(NAME, NULL) \179 #define PS_POLY_CHECK_NULL(NAME, RVAL) \ 169 180 if (NAME == NULL || NAME->coeff == NULL) { \ 170 181 psError(__func__,"Unallowable operation: polynomial %s or its coeffs is NULL.", #NAME); \ 171 return( NULL); \182 return(RVAL); \ 172 183 } \ 173 184
Note:
See TracChangeset
for help on using the changeset viewer.
