Changeset 2197 for trunk/psLib/src/math/psConstants.h
- Timestamp:
- Oct 26, 2004, 11:25:59 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psConstants.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psConstants.h
r2136 r2197 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10- 14 23:43:12 $8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-26 21:24:42 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 107 107 } \ 108 108 109 /** Preprocessor macro to generate error on a NULL vector */ 110 #define PS_CHECK_NULL_VECTOR_RETURN_F0(NAME) \ 111 if (NAME == NULL || NAME->data.V == NULL) { \ 112 psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME); \ 113 return(0.0); \ 114 } \ 115 109 116 /** Preprocessor macro to generate error on a NULL poniter */ 110 117 #define PS_CHECK_NULL_PTR_RETURN_NULL(NAME) \ … … 113 120 return(NULL); \ 114 121 } 122 123 /** Preprocessor macro to generate error on a NULL poniter */ 124 #define PS_CHECK_NULL_PTR_RETURN_F0(NAME) \ 125 if (NAME == NULL) { \ 126 psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \ 127 return(0.0); \ 128 } 129 115 130 /** Preprocessor macro to generate error on a NULL poniter */ 116 131 #define PS_CHECK_NULL_PTR_RETURN_ZERO(NAME) \ … … 127 142 } \ 128 143 144 /** Preprocessor macro to generate error for zero length vector */ 145 #define PS_CHECK_EMPTY_VECTOR_RETURN_F0(NAME) \ 146 if (NAME->n < 1) { \ 147 psError(__func__,"Unallowable operation: %s has zero n value.", #NAME); \ 148 return(0.0); \ 149 } \ 150 129 151 /** Preprocessor macro to generate error on differing size vectors */ 130 152 #define PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_NULL(VEC1, VEC2) \ … … 132 154 psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \ 133 155 return(NULL); \ 156 } 157 158 /** Preprocessor macro to generate error on differing size vectors */ 159 #define PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_F0(VEC1, VEC2) \ 160 if (VEC1->n != VEC2->n) { \ 161 psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \ 162 return(0.0); \ 134 163 } 135 164 … … 199 228 200 229 #define PS_MAX(A, B) \ 201 (( A > B) ? A : B) \230 (((A) > (B)) ? (A) : (B)) \ 202 231 203 232 #define PS_MIN(A, B) \ 204 (( A < B) ? A : B) \205 233 (((A) < (B)) ? (A) : (B)) \ 234
Note:
See TracChangeset
for help on using the changeset viewer.
