Changeset 1807
- Timestamp:
- Sep 14, 2004, 10:01:52 AM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 added
- 21 deleted
- 36 edited
-
psLib.kdevses (modified) (1 diff)
-
src/collections/psArray.c (modified) (4 diffs)
-
src/collections/psBitSet.c (modified) (12 diffs)
-
src/collections/psBitSet.h (modified) (6 diffs)
-
src/collections/psCollectionsErrors.dat (modified) (1 diff)
-
src/collections/psCollectionsErrors.h (modified) (2 diffs)
-
src/collections/psList.c (modified) (3 diffs)
-
src/collections/psScalar.c (modified) (7 diffs)
-
src/collections/psVector.c (modified) (9 diffs)
-
src/mathtypes/psScalar.c (modified) (7 diffs)
-
src/mathtypes/psVector.c (modified) (9 diffs)
-
src/parseErrorCodes.pl (modified) (1 diff)
-
src/psErrorCodes.dat (modified) (1 diff)
-
src/sys/psError.c (modified) (4 diffs)
-
src/sys/psError.h (modified) (3 diffs)
-
src/sys/psErrorCodes.c (modified) (2 diffs)
-
src/sys/psErrorCodes.h (modified) (2 diffs)
-
src/sys/psLogMsg.c (modified) (2 diffs)
-
src/sys/psLogMsg.h (modified) (2 diffs)
-
src/sysUtils/psError.c (modified) (4 diffs)
-
src/sysUtils/psError.h (modified) (3 diffs)
-
src/sysUtils/psErrorCodes.c (modified) (2 diffs)
-
src/sysUtils/psErrorCodes.h (modified) (2 diffs)
-
src/sysUtils/psLogMsg.c (modified) (2 diffs)
-
src/sysUtils/psLogMsg.h (modified) (2 diffs)
-
src/types/psArray.c (modified) (4 diffs)
-
src/types/psBitSet.c (modified) (12 diffs)
-
src/types/psBitSet.h (modified) (6 diffs)
-
src/types/psList.c (modified) (3 diffs)
-
test/collections/Makefile (modified) (2 diffs)
-
test/collections/tst_psBitSet.c (added)
-
test/collections/tst_psBitSet_01.c (deleted)
-
test/collections/tst_psBitSet_02.c (deleted)
-
test/collections/tst_psBitSet_03.c (deleted)
-
test/collections/tst_psBitSet_04.c (deleted)
-
test/collections/tst_psBitSet_05.c (deleted)
-
test/collections/tst_psBitSet_06.c (deleted)
-
test/collections/tst_psBitSet_07.c (deleted)
-
test/collections/tst_psBitSet_08.c (deleted)
-
test/collections/verified/tst_psBitSet.stderr (added)
-
test/collections/verified/tst_psBitSet_01.stderr (deleted)
-
test/collections/verified/tst_psBitSet_01.stdout (deleted)
-
test/collections/verified/tst_psBitSet_02.stdout (deleted)
-
test/collections/verified/tst_psBitSet_03.stdout (deleted)
-
test/collections/verified/tst_psBitSet_04.stdout (deleted)
-
test/collections/verified/tst_psBitSet_05.stderr (deleted)
-
test/collections/verified/tst_psBitSet_05.stdout (deleted)
-
test/collections/verified/tst_psBitSet_06.stderr (deleted)
-
test/collections/verified/tst_psBitSet_06.stdout (deleted)
-
test/collections/verified/tst_psBitSet_07.stdout (deleted)
-
test/collections/verified/tst_psBitSet_08.stderr (deleted)
-
test/collections/verified/tst_psBitSet_08.stdout (deleted)
-
test/collections/verified/tst_psVector.stderr (modified) (1 diff)
-
test/collections/verified/tst_psVector.stdout (deleted)
-
test/collections/verified/tst_psVectorSort_02.stderr (modified) (1 diff)
-
test/collections/verified/tst_psVectorSort_02.stdout (modified) (2 diffs)
-
test/collections/verified/tst_psVectorSort_03.stderr (modified) (1 diff)
-
test/collections/verified/tst_psVectorSort_04.stderr (modified) (1 diff)
-
test/collections/verified/tst_psVectorSort_04.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/psLib.kdevses
r1761 r1807 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments="5" > 5 <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psCollectionsErrors.dat" > 6 <View0 line="8" Type="???" > 7 <AdditionalSettings Top="2" Width="1229" Attach="1" Height="705" Left="2" MinMaxMode="0" /> 8 </View0> 9 </Doc0> 10 <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/Makefile" > 11 <View0 line="62" Type="???" > 12 <AdditionalSettings Top="2" Width="1229" Attach="1" Height="705" Left="2" MinMaxMode="0" /> 13 </View0> 14 </Doc1> 15 <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/sysUtils/Makefile" > 16 <View0 line="55" Type="???" > 17 <AdditionalSettings Top="2" Width="1229" Attach="1" Height="705" Left="2" MinMaxMode="0" /> 18 </View0> 19 </Doc2> 20 <Doc3 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psVector.c" > 21 <View0 line="39" Type="???" > 22 <AdditionalSettings Top="2" Width="1229" Attach="1" Height="705" Left="2" MinMaxMode="0" /> 23 </View0> 24 </Doc3> 25 <Doc4 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psCollectionsErrors.h" > 26 <View0 line="0" Type="???" > 27 <AdditionalSettings Top="2" Width="1229" Attach="1" Height="705" Left="2" MinMaxMode="0" /> 28 </View0> 29 </Doc4> 30 </DocsAndViews> 4 <DocsAndViews NumberOfDocuments="0" /> 31 5 <pluginList> 32 6 <kdevbookmarks> -
trunk/psLib/src/collections/psArray.c
r1651 r1807 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-27 23:54:33$11 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-14 20:01:52 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psArray.h" 27 27 #include "psLogMsg.h" 28 29 #include "psCollectionsErrors.h" 28 30 29 31 /*****************************************************************************/ … … 43 45 psArray* psArr = NULL; 44 46 45 // Invalid nalloc46 if (nalloc < 1) {47 psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);48 return NULL;49 }50 47 // Create vector struct 51 48 psArr = (psArray* ) psAlloc(sizeof(psArray)); … … 63 60 psArray* psArrayRealloc(unsigned int nalloc, psArray* restrict in) 64 61 { 65 // Invalid nalloc66 if (nalloc < 1) {67 psError(__func__, "Invalid value for realloc (%d)\n", nalloc);68 return NULL;69 }70 71 62 if (in == NULL) { 72 63 return psArrayAlloc(nalloc); -
trunk/psLib/src/collections/psBitSet.c
r1440 r1807 1 2 1 /** @file psBitSet.c 3 2 * … … 10 9 * 11 10 * @author Ross Harman, MHPCC 12 * 13 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:57 $ 11 * @author Robert DeSonia, MHPCC 12 * 13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 17 17 */ 18 18 19 /******************************************************************************/20 21 /* INCLUDE FILES */22 23 /******************************************************************************/24 19 #include <string.h> 25 20 #include <stdio.h> … … 32 27 #include "psError.h" 33 28 #include "psAbort.h" 34 35 /******************************************************************************/ 36 37 /* DEFINE STATEMENTS */ 38 39 /******************************************************************************/ 40 41 // None 42 43 /******************************************************************************/ 44 45 /* TYPE DEFINITIONS */ 46 47 /******************************************************************************/ 48 49 // None 50 51 /*****************************************************************************/ 52 53 /* GLOBAL VARIABLES */ 54 55 /*****************************************************************************/ 56 57 // None 58 59 /*****************************************************************************/ 60 61 /* FILE STATIC VARIABLES */ 62 63 /*****************************************************************************/ 64 65 // None 66 67 /*****************************************************************************/ 68 69 /* FUNCTION IMPLEMENTATION - LOCAL */ 70 71 /*****************************************************************************/ 72 static void psBitSetFree(psBitSet* restrict inBitSet); 29 #include "psString.h" 30 31 #include "psCollectionsErrors.h" 32 33 enum { 34 UNKNOWN_OP, 35 AND_OP, 36 OR_OP, 37 XOR_OP, 38 NOT_OP 39 }; 40 41 static void bitSetFree(psBitSet* restrict inBitSet); 73 42 74 43 /** Private function to create a mask. … … 90 59 } 91 60 92 /*****************************************************************************/ 93 94 /* FUNCTION IMPLEMENTATION - PUBLIC */ 95 96 /*****************************************************************************/ 61 static void bitSetFree(psBitSet* restrict inBitSet) 62 { 63 if (inBitSet == NULL) { 64 return; 65 } 66 psFree(inBitSet->bits); 67 } 68 97 69 psBitSet* psBitSetAlloc(int n) 98 70 { … … 100 72 psBitSet* newObj = NULL; 101 73 102 if (n <= 0) { 103 psError(__func__, " : Line %d - Allocation size must be > 0: size = %d", __LINE__, n); 104 return 0; 74 if (n < 0) { 75 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetAlloc", 76 PS_ERR_BAD_PARAMETER_VALUE, true, 77 PS_ERRORTEXT_psBitSet_ALLOC_NEG_SIZE, 78 n); 79 return NULL; 105 80 } 106 81 107 82 numBytes = ceil(n / 8.0); 108 83 newObj = psAlloc(sizeof(psBitSet)); 109 if (newObj == NULL) { 110 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__); 111 } 112 p_psMemSetDeallocator(newObj, (psFreeFcn) psBitSetFree); 84 p_psMemSetDeallocator(newObj, (psFreeFcn) bitSetFree); 113 85 newObj->n = numBytes; 114 86 … … 116 88 /* @i@ */ 117 89 newObj->bits = psAlloc(sizeof(char) * numBytes); 118 if (newObj->bits == NULL) { 119 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__); 120 } 121 122 memset(newObj->bits, numBytes, 0); 90 91 memset(newObj->bits, 0, numBytes); 123 92 124 93 return newObj; 125 94 } 126 95 127 static void psBitSetFree(psBitSet* restrict inBitSet)128 {129 if (inBitSet == NULL) {130 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);131 return;132 }133 psFree(inBitSet->bits);134 }135 136 96 psBitSet* psBitSetSet(psBitSet* inBitSet, int bit) 137 97 { … … 139 99 140 100 if (inBitSet == NULL) { 141 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 101 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetSet", 102 PS_ERR_BAD_PARAMETER_NULL, true, 103 PS_ERRORTEXT_psBitSet_SET_NULL); 142 104 return inBitSet; 143 } else if (bit < 0) { 144 psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit); 145 return inBitSet; 146 } else if (bit > inBitSet->n * 8 - 1) { 147 psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit); 105 } else if ( (bit < 0) || 106 (bit > inBitSet->n * 8 - 1) ) { 107 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetSet", 108 PS_ERR_BAD_PARAMETER_VALUE, true, 109 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 110 bit,inBitSet->n * 8 - 1); 148 111 return inBitSet; 149 112 } … … 155 118 } 156 119 120 psBitSet* psBitSetClear(psBitSet* inBitSet, int bit) 121 { 122 char *byte = NULL; 123 124 if (inBitSet == NULL) { 125 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetClear", 126 PS_ERR_BAD_PARAMETER_NULL, true, 127 PS_ERRORTEXT_psBitSet_SET_NULL); 128 return inBitSet; 129 } else if ( (bit < 0) || 130 (bit > inBitSet->n * 8 - 1) ) { 131 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetClear", 132 PS_ERR_BAD_PARAMETER_VALUE, true, 133 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 134 bit,inBitSet->n * 8 - 1); 135 return inBitSet; 136 } 137 // Variable byte is the byte in the array that contains the bit to be set 138 byte = inBitSet->bits + bit / 8; 139 *byte &= ! mask(bit); 140 141 return inBitSet; 142 } 143 157 144 bool psBitSetTest(const psBitSet* inBitSet, int bit) 158 145 { … … 160 147 161 148 if (inBitSet == NULL) { 162 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 163 return 0; 164 } else if (bit < 0) { 165 psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit); 166 return 0; 167 } else if (bit > inBitSet->n * 8 - 1) { 168 psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit); 169 return 0; 170 } 149 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetTest", 150 PS_ERR_BAD_PARAMETER_NULL, true, 151 PS_ERRORTEXT_psBitSet_SET_NULL); 152 return false; 153 } else if ( (bit < 0) || 154 (bit > inBitSet->n * 8 - 1) ) { 155 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetTest", 156 PS_ERR_BAD_PARAMETER_VALUE, true, 157 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 158 bit,inBitSet->n * 8 - 1); 159 return false; 160 } 161 171 162 // Variable byte is the byte in the array that contains the bit to be tested 172 163 byte = inBitSet->bits + bit / 8; 173 if ((int)(*byte & mask(bit)) == 0) { 174 return 0; 175 } 176 177 return 1; 164 return ((*byte & mask(bit)) != 0); 178 165 } 179 166 … … 183 170 int i = 0; 184 171 int n = 0; 185 char tempChar = '0';186 char *outBits= NULL;187 char *inBits1= NULL;188 char *inBits2 = NULL;172 char* outBits = NULL; 173 char* inBits1 = NULL; 174 char* inBits2 = NULL; 175 int op = UNKNOWN_OP; 189 176 190 177 if (inBitSet1 == NULL) { 191 psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument", __LINE__); 192 return outBitSet; 193 } 178 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 179 PS_ERR_BAD_PARAMETER_NULL, true, 180 PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL); 181 psFree(outBitSet); 182 return NULL; 183 } 184 inBits1 = inBitSet1->bits; 194 185 195 186 if (operator == NULL) { 196 psError(__func__, " : Line %d - Null input operator\n", __LINE__); 197 return outBitSet; 198 } 199 200 if (inBitSet2 == NULL) { 201 psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument", __LINE__); 202 return outBitSet; 187 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 188 PS_ERR_BAD_PARAMETER_NULL, true, 189 PS_ERRORTEXT_psBitSet_OPERATOR_NULL); 190 psFree(outBitSet); 191 return NULL; 192 } 193 194 // make operator all caps 195 int tempStrLen = strlen(operator); 196 char* tempStr = psAlloc(tempStrLen+1); 197 198 for (int lcv=0;lcv<tempStrLen;lcv++) { 199 tempStr[lcv] = (char)toupper(operator[lcv]); 200 } 201 tempStr[tempStrLen] = '\0'; 202 203 // parse the operator 204 if (strcmp(operator,"AND")==0) { 205 op = AND_OP; 206 } else if (strcmp(operator,"OR")==0) { 207 op = OR_OP; 208 } else if (strcmp(operator,"XOR")==0) { 209 op = XOR_OP; 210 } else if (strcmp(operator,"NOT")==0) { 211 op = NOT_OP; 212 } else { 213 psFree(tempStr); 214 psFree(outBitSet); 215 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 216 PS_ERR_BAD_PARAMETER_VALUE, true, 217 PS_ERRORTEXT_psBitSet_OPERATOR_INVALID, 218 operator); 219 return NULL; 220 } 221 psFree(tempStr); 222 223 if (op != NOT_OP) { 224 if (inBitSet2 == NULL) { 225 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 226 PS_ERR_BAD_PARAMETER_NULL, true, 227 PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL); 228 psFree(outBitSet); 229 return NULL; 230 } 231 232 if (inBitSet1->n != inBitSet2->n) { 233 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 234 PS_ERR_BAD_PARAMETER_SIZE, true, 235 PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER); 236 psFree(outBitSet); 237 return NULL; 238 } 239 inBits2 = inBitSet2->bits; 203 240 } 204 241 205 242 if (outBitSet == NULL) { 206 outBitSet = psBitSetAlloc(inBitSet1->n * 8); 207 } 208 209 if (inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) { 210 psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__); 211 return outBitSet; 243 outBitSet = psBitSetAlloc(inBitSet1->n*8); 244 } else if (outBitSet->n != inBitSet1->n) { 245 outBitSet->n = inBitSet1->n; 246 outBitSet->bits = psRealloc(outBitSet->bits, inBitSet1->n); 212 247 } 213 248 214 249 n = outBitSet->n; 215 250 outBits = outBitSet->bits; 216 inBits1 = inBitSet1->bits; 217 inBits2 = inBitSet2->bits; 218 219 tempChar = toupper(operator[0]); 220 switch (tempChar) { 221 case 'A': 251 252 switch (op) { 253 case AND_OP: 222 254 for (i = 0; i < n; i++) { 223 255 outBits[i] = inBits1[i] & inBits2[i]; 224 256 } 225 257 break; 226 case 'O':258 case OR_OP: 227 259 for (i = 0; i < n; i++) { 228 260 outBits[i] = inBits1[i] | inBits2[i]; 229 261 } 230 262 break; 231 case 'X':263 case XOR_OP: 232 264 for (i = 0; i < n; i++) { 233 265 outBits[i] = inBits1[i] ^ inBits2[i]; 234 266 } 235 267 break; 268 case NOT_OP: 269 for (i = 0; i < n; i++) { 270 outBits[i] = ~inBits1[i]; 271 } 272 break; 236 273 default: 237 psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s", __LINE__, operator); 274 psAbort(PS_ERRORNAME_DOMAIN "psBitSetOp", 275 "Unexpected error - operator parsed successfully but not valid?"); 238 276 } 239 277 … … 243 281 psBitSet* psBitSetNot(psBitSet* outBitSet, const psBitSet* restrict inBitSet) 244 282 { 245 int i = 0; 246 int n = 0; 247 char *outBits = NULL; 248 char *inBits = NULL; 249 250 if (inBitSet == NULL) { 251 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 252 return outBitSet; 253 } 254 255 n = inBitSet->n; 256 if (n == 0) { 257 psError(__func__, " : Line %d - No elements in inBitSet", __LINE__); 258 return outBitSet; 259 } 283 if (inBitSet == NULL) { 284 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetNot", 285 PS_ERR_BAD_PARAMETER_NULL, true, 286 PS_ERRORTEXT_psBitSet_OPERAND_NULL); 287 psFree(outBitSet); 288 return NULL; 289 } 290 291 outBitSet = psBitSetOp(outBitSet,inBitSet,"NOT",NULL); 260 292 261 293 if (outBitSet == NULL) { 262 outBitSet = psBitSetAlloc(n * 8); 263 } 264 265 if (inBitSet->n != outBitSet->n) { 266 psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__); 267 return outBitSet; 268 } 269 270 outBits = outBitSet->bits; 271 inBits = inBitSet->bits; 272 273 for (i = 0; i < n; i++) { 274 outBits[i] = ~inBits[i]; 294 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetNot", 295 PS_ERR_UNKNOWN, false, 296 PS_ERRORTEXT_psBitSet_NOT_OP_FAILED); 275 297 } 276 298 … … 284 306 char *outString = psAlloc((size_t) numBits + 1); 285 307 286 if (outString == NULL) {287 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);288 }289 290 308 for (i = 0; i < numBits; i++) { 291 outString[numBits - i - 1] = (psBitSetTest(inBitSet, i) == 1) ? '1' : '0';309 outString[numBits - i - 1] = psBitSetTest(inBitSet, i) ? '1' : '0'; 292 310 } 293 311 -
trunk/psLib/src/collections/psBitSet.h
r1472 r1807 1 2 1 /** @file psBitSet.h 3 2 * … … 13 12 * @author Ross Harman, MHPCC 14 13 * 15 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 8-11 19:53:33$14 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-14 20:01:52 $ 17 16 * 18 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 25 27 26 /******************************************************************************/ 28 29 27 /* TYPE DEFINITIONS */ 30 31 28 /******************************************************************************/ 32 29 … … 44 41 45 42 /*****************************************************************************/ 46 47 43 /* FUNCTION PROTOTYPES */ 48 49 44 /*****************************************************************************/ 50 45 … … 64 59 /** Set a bit. 65 60 * 66 * Sets a bit at a given bit location , either one or zero. The bit is set based on a zero index with the61 * Sets a bit at a given bit location. The bit is set based on a zero index with the 67 62 * first bit set in the zero bit slot of the zero element of the byte array. As an example, setting bit 3 in 68 63 * an array with two elements would result in an psBitSet that looks like 00000000 00001000. … … 74 69 psBitSet* restrict inMask, ///< Pointer to psBitSet to be set. 75 70 int bit ///< Bit to be set. 71 ); 72 73 /** Clear a bit. 74 * 75 * Clear a bit at a given bit location. The bit is cleared based on a zero 76 * index with the first bit set in the zero bit slot of the zero element of 77 * the byte array. 78 * 79 * @return psBitSet* : Pointer to struct containing psBitSet. 80 */ 81 psBitSet* psBitSetClear( 82 /* @returned@ */ 83 psBitSet* restrict inMask, ///< Pointer to psBitSet to be cleared. 84 int bit ///< Bit to be cleared. 76 85 ); 77 86 -
trunk/psLib/src/collections/psCollectionsErrors.dat
r1762 r1807 7 7 # N.B. in code, the ERRORNAME appears as PS_ERRORTEXT_ERRORNAME 8 8 #################################################################### 9 psVector_NALLOC_NOT_POSITIVE Parameter nalloc (%d) must be positive. 9 # 10 psVector_REALLOC_NULL psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. 11 psVector_SORT_NULL psVectorSort can not sort a NULL psVector. 12 psVector_UNSUPPORTED_TYPE Input psVector is an unsupported type (%d). 13 # 14 psBitSet_ALLOC_NEG_SIZE The number of bit in a psBitSet (%d) must be greater than zero. 15 psBitSet_SET_NULL Can not operate on a NULL psBitSet. 16 psBitSet_BIT_OUTOFRANGE The specified bit position (%d) is invalid. Position must be between 0 and %d. 17 psBitSet_OPERATOR_NULL Specified operator is NULL. Must specify desired operator. 18 psBitSet_OPERATOR_INVALID Specified operator, %s, is invalid. Valid operators are AND, OR, and XOR. 19 psBitSet_FIRST_OPERAND_NULL First psBitSet operand can not be NULL. 20 psBitSet_SECOND_OPERAND_NULL Second psBitSet operand can not be NULL. 21 psBitSet_OPERANDS_SIZE_DIFFER The psBitSet operand must be the same size. 22 psBitSet_NOT_OP_FAILED Could not perform NOT operation. 23 psBitSet_OPERAND_NULL Operand can not be NULL. 24 # 25 psScalar_UNSUPPORTED_TYPE Specified datatype (%d) is unsupported by psScalar. 26 psScalar_COPY_NULL Can not copy a NULL psScalar. -
trunk/psLib/src/collections/psCollectionsErrors.h
r1787 r1807 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-1 1 00:43:54$9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-14 20:01:52 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 31 31 //~Start #define PS_ERRORTEXT_$1 "$2" 32 #define PS_ERRORTEXT_psVector_NALLOC_NOT_POSITIVE "Parameter nalloc (%d) must be positive" 32 #define PS_ERRORTEXT_psVector_REALLOC_NULL "psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown." 33 #define PS_ERRORTEXT_psVector_SORT_NULL "psVectorSort can not sort a NULL psVector." 34 #define PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE "Input psVector is an unsupported type (%d)." 35 #define PS_ERRORTEXT_psBitSet_ALLOC_NEG_SIZE "The number of bit in a psBitSet (%d) must be greater than zero." 36 #define PS_ERRORTEXT_psBitSet_SET_NULL "Can not operate on a NULL psBitSet." 37 #define PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE "The specified bit position (%d) is invalid. Position must be between 0 and %d." 38 #define PS_ERRORTEXT_psBitSet_OPERATOR_NULL "Specified operator is NULL. Must specify desired operator." 39 #define PS_ERRORTEXT_psBitSet_OPERATOR_INVALID "Specified operator, %s, is invalid. Valid operators are AND, OR, and XOR." 40 #define PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL "First psBitSet operand can not be NULL." 41 #define PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL "Second psBitSet operand can not be NULL." 42 #define PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER "The psBitSet operand must be the same size." 43 #define PS_ERRORTEXT_psBitSet_NOT_OP_FAILED "Could not perform NOT operation." 44 #define PS_ERRORTEXT_psBitSet_OPERAND_NULL "Operand can not be NULL." 45 #define PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE "Specified datatype (%d) is unsupported by psScalar." 46 #define PS_ERRORTEXT_psScalar_COPY_NULL "Can not copy a NULL psScalar." 33 47 //~End 34 48 -
trunk/psLib/src/collections/psList.c
r1747 r1807 1 2 1 /** @file psList.c 3 2 * @brief Support for doubly linked lists … … 7 6 * @author Robert Daniel DeSonia, MHPCC 8 7 * 9 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09- 09 02:23:27$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-14 20:01:52 $ 11 10 * 12 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 23 #include "psTrace.h" 25 24 #include "psLogMsg.h" 25 26 #include "psCollectionsErrors.h" 26 27 27 28 #define ITER_INIT_HEAD ((void *)1) // next iteration should return head -
trunk/psLib/src/collections/psScalar.c
r1648 r1807 1 2 1 /** @file psScalar.c 3 2 * … … 9 8 * @author Ross Harman, MHPCC 10 9 * 11 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-27 23:34:05$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-09-14 20:01:52 $ 13 12 * 14 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 14 */ 16 15 17 /******************************************************************************/18 19 /* INCLUDE FILES */20 21 /******************************************************************************/22 16 #include "psMemory.h" 23 17 #include "psError.h" … … 26 20 #include "psAbort.h" 27 21 28 /******************************************************************************/ 22 #include "psCollectionsErrors.h" 29 23 30 /* DEFINE STATEMENTS */31 32 /******************************************************************************/33 34 // None35 36 /******************************************************************************/37 38 /* TYPE DEFINITIONS */39 40 /******************************************************************************/41 42 // None43 44 /*****************************************************************************/45 46 /* GLOBAL VARIABLES */47 48 /*****************************************************************************/49 50 // None51 52 /*****************************************************************************/53 54 /* FILE STATIC VARIABLES */55 56 /*****************************************************************************/57 58 // None59 60 /*****************************************************************************/61 62 /* FUNCTION IMPLEMENTATION - LOCAL */63 64 /*****************************************************************************/65 66 // None67 68 /*****************************************************************************/69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */71 72 /*****************************************************************************/73 24 psScalar* psScalarAlloc(psC64 value, psElemType dataType) 74 25 { … … 77 28 // Create scalar 78 29 scalar = (psScalar* ) psAlloc(sizeof(psScalar)); 79 if (scalar == NULL) {80 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);81 }82 30 83 31 scalar->type.dimen = PS_DIMEN_SCALAR; … … 122 70 break; 123 71 default: 124 psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType); 72 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarAlloc", 73 PS_ERR_BAD_PARAMETER_TYPE, true, 74 PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE, 75 dataType); 125 76 } 126 77 … … 134 85 135 86 if (scalar == NULL) { 136 psError(__func__, "Null scalar not allowed"); 87 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy", 88 PS_ERR_BAD_PARAMETER_NULL, true, 89 PS_ERRORTEXT_psScalar_COPY_NULL); 90 return NULL; 137 91 } 138 92 … … 176 130 break; 177 131 default: 178 psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType); 132 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy", 133 PS_ERR_BAD_PARAMETER_TYPE, true, 134 PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE, 135 dataType); 179 136 } 180 137 -
trunk/psLib/src/collections/psVector.c
r1761 r1807 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 09 21:59:03$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-14 20:01:52 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psLogMsg.h" 26 26 #include "psCompare.h" 27 27 28 #include "psCollectionsErrors.h" 28 29 29 30 static void vectorFree(psVector* restrict psVec); 31 32 33 static void vectorFree(psVector* restrict psVec) 34 { 35 if (psVec == NULL) { 36 return; 37 } 38 39 psFree(psVec->data.V); 40 } 30 41 31 42 // FUNCTION IMPLEMENTATION - PUBLIC … … 35 46 psVector* psVec = NULL; 36 47 int elementSize = 0; 37 38 // Invalid nalloc39 if (nalloc < 1) {40 psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);41 return NULL;42 }43 48 44 49 elementSize = PSELEMTYPE_SIZEOF(elemType); … … 64 69 psElemType elemType; 65 70 66 // Invalid nalloc67 if (nalloc < 1) {68 psError(__func__, "Invalid value for realloc (%d)\n", nalloc);69 return NULL;70 }71 72 71 if (in == NULL) { 73 psError(__func__, "Null input vector\n"); 72 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorRealloc", 73 PS_ERR_BAD_PARAMETER_NULL, true, 74 PS_ERRORTEXT_psVector_REALLOC_NULL); 74 75 return NULL; 75 76 } else if (in->nalloc != nalloc) { // No need to realloc to same size … … 101 102 return in; 102 103 } 103 // Invalid nalloc104 if (nalloc < 1) {105 psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);106 psFree(in);107 return NULL;108 }109 104 110 105 in->data.V = psRealloc(in->data.V, nalloc * PSELEMTYPE_SIZEOF(type)); … … 119 114 psVector* psVectorSort(psVector* restrict outVector, const psVector* restrict inVector) 120 115 { 121 int inN = 0; 122 int outN = 0; 116 int N = 0; 123 117 int elSize = 0; 124 118 void *inVec = NULL; … … 127 121 128 122 if (inVector == NULL) { 129 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 130 return outVector; 123 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSort", 124 PS_ERR_BAD_PARAMETER_NULL, true, 125 PS_ERRORTEXT_psVector_SORT_NULL); 126 psFree(outVector); 127 return NULL; 131 128 } 132 129 133 130 inType = inVector->type.type; 134 inN = inVector->n;131 N = inVector->n; 135 132 inVec = inVector->data.V; 136 133 elSize = PSELEMTYPE_SIZEOF(inType); 137 134 138 135 if (outVector == NULL) { 139 outVector = psVectorAlloc(inN, inType); 140 outVector->n = inVector->n; 141 } 142 143 outN = outVector->n; 136 outVector = psVectorAlloc(N, inType); 137 } 138 139 // check to see if output vector needs to be resized/retyped 140 if ( (N > outVector->nalloc) || 141 (inType != outVector->type.type) ) { 142 // reshape the output vector to match the input vector's size/type. 143 outVector = psVectorRecycle(outVector,N,inType); 144 } 145 outVector->n = N; 144 146 outVec = outVector->data.V; 145 147 146 if (inN != outN) { 147 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", 148 __LINE__, inN, outN); 148 if (N == 0) { 149 // no need to sort anything, as there are no elements in input vector. 149 150 return outVector; 150 151 } 151 152 152 if (inType != outVector->type.type) { 153 psError(__func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__, 154 inType, outVector->type.type); 155 return outVector; 156 } 157 158 if (inN == 0) { 159 psError(__func__, " : Line %d - No elements in use for input vector\n", __LINE__); 160 return outVector; 161 } 162 163 if (outN == 0) { 164 psError(__func__, " : Line %d - No elements in use for output vector\n", __LINE__); 165 return outVector; 166 } 167 // Copy input vector values into output vector 168 memcpy(outVec, inVec, elSize * outN); 153 // Copy input vector values into output vector if not in-place sorting 154 if (inVector != outVector) { 155 memcpy(outVec, inVec, elSize * N); 156 } 169 157 170 158 // Sort output vector 171 159 switch (inType) { 172 160 case PS_TYPE_U8: 173 qsort(outVec, inN, elSize, psCompareU8);161 qsort(outVec, N, elSize, psCompareU8); 174 162 break; 175 163 case PS_TYPE_U16: 176 qsort(outVec, inN, elSize, psCompareU16);164 qsort(outVec, N, elSize, psCompareU16); 177 165 break; 178 166 case PS_TYPE_U32: 179 qsort(outVec, inN, elSize, psCompareU32);167 qsort(outVec, N, elSize, psCompareU32); 180 168 break; 181 169 case PS_TYPE_U64: 182 qsort(outVec, inN, elSize, psCompareU64);170 qsort(outVec, N, elSize, psCompareU64); 183 171 break; 184 172 case PS_TYPE_S8: 185 qsort(outVec, inN, elSize, psCompareS8);173 qsort(outVec, N, elSize, psCompareS8); 186 174 break; 187 175 case PS_TYPE_S16: 188 qsort(outVec, inN, elSize, psCompareS16);176 qsort(outVec, N, elSize, psCompareS16); 189 177 break; 190 178 case PS_TYPE_S32: 191 qsort(outVec, inN, elSize, psCompareS32);179 qsort(outVec, N, elSize, psCompareS32); 192 180 break; 193 181 case PS_TYPE_S64: 194 qsort(outVec, inN, elSize, psCompareS64);182 qsort(outVec, N, elSize, psCompareS64); 195 183 break; 196 184 case PS_TYPE_F32: 197 qsort(outVec, inN, elSize, psCompareF32);185 qsort(outVec, N, elSize, psCompareF32); 198 186 break; 199 187 case PS_TYPE_F64: 200 qsort(outVec, inN, elSize, psCompareF64);188 qsort(outVec, N, elSize, psCompareF64); 201 189 break; 202 190 default: 203 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 191 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSort", 192 PS_ERR_BAD_PARAMETER_TYPE, true, 193 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 194 inType); 204 195 } 205 196 … … 207 198 } 208 199 209 #define SORT_INDICES(TYPE) \210 for(i=0; i<inN; i++) { \211 for(j=0; j<inN; j++) { \212 diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]); \213 if(diff < FLT_EPSILON) { \214 outVec[i] = j; \215 break; \216 } \217 } \218 }219 220 200 psVector* psVectorSortIndex(psVector* restrict outVector, const psVector* restrict inVector) 221 201 { 222 int inN = 0; 223 int outN = 0; 224 int i = 0; 225 int j = 0; 226 float *inVec = NULL; 227 int *outVec = NULL; 228 double diff = 0.0f; 202 int N = 0; 229 203 psVector* tmpVector = NULL; 230 204 psElemType inType = 0; 205 psU32* outVec; 231 206 232 207 if (inVector == NULL) { 233 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 208 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSortIndex", 209 PS_ERR_BAD_PARAMETER_NULL, true, 210 PS_ERRORTEXT_psVector_SORT_NULL); 211 psFree(outVector); 212 return NULL; 213 } 214 215 N = inVector->n; 216 217 if (outVector == NULL) { 218 outVector = psVectorAlloc(N, PS_TYPE_U32); 219 } 220 221 // check to see if output vector needs to be resized/retyped 222 if ( (N > outVector->nalloc) || 223 (outVector->type.type != PS_TYPE_U32) ) { 224 // reshape the output vector to match the input vector's size/type. 225 outVector = psVectorRecycle(outVector,N,PS_TYPE_U32); 226 } 227 outVector->n = N; 228 outVec = outVector->data.U32; 229 230 if (N == 0) { 231 // no need to sort anything, as there are no elements in input vector. 234 232 return outVector; 235 233 } 236 234 237 inN = inVector->n;238 inVec = inVector->data.V;239 inType = inVector->type.type;240 241 if (outVector == NULL) {242 outVector = psVectorAlloc(inN, PS_TYPE_U32);243 outVector->n = inN;244 }245 246 outN = outVector->n;247 outVec = outVector->data.V;248 249 if (inN != outN) {250 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",251 __LINE__, inN, outN);252 return outVector;253 }254 255 if (outVector->type.type != PS_TYPE_U32) {256 psError(__func__, " : Line %d - Output vector is not of type U32: out=%d\n",257 __LINE__, outVector->type.type);258 return outVector;259 }260 261 tmpVector = psVectorAlloc(inN, inType);262 tmpVector->n = inN;263 235 tmpVector = psVectorSort(tmpVector, inVector); 236 237 #define SORT_INDICES(TYPE,absfcn,maxError) { \ 238 ps##TYPE* inVec = inVector->data.TYPE; \ 239 ps##TYPE* tmpVec = tmpVector->data.TYPE; \ 240 ps##TYPE diff; \ 241 for(int i=0; i<N; i++) { \ 242 for(int j=0; j<N; j++) { \ 243 diff = absfcn(tmpVec[i] - inVec[j]); \ 244 if(diff < maxError) { \ 245 outVec[i] = j; \ 246 break; \ 247 } \ 248 } \ 249 } \ 250 } 264 251 265 252 // Sort output vector 266 253 switch (inType) { 267 254 case PS_TYPE_U8: 268 SORT_INDICES(U8 );255 SORT_INDICES(U8,/* no absfcn needed */,1); 269 256 break; 270 257 case PS_TYPE_U16: 271 SORT_INDICES(U16 );258 SORT_INDICES(U16,/* no absfcn needed */,1); 272 259 break; 273 260 case PS_TYPE_U32: 274 SORT_INDICES(U32 );261 SORT_INDICES(U32,/* no absfcn needed */,1); 275 262 break; 276 263 case PS_TYPE_U64: 277 SORT_INDICES(U64 );264 SORT_INDICES(U64,/* no absfcn needed */,1); 278 265 break; 279 266 case PS_TYPE_S8: 280 SORT_INDICES(S8 );267 SORT_INDICES(S8,/* no absfcn needed */,1); 281 268 break; 282 269 case PS_TYPE_S16: 283 SORT_INDICES(S16 );270 SORT_INDICES(S16,/* no absfcn needed */,1); 284 271 break; 285 272 case PS_TYPE_S32: 286 SORT_INDICES(S32 );273 SORT_INDICES(S32,/* no absfcn needed */,1); 287 274 break; 288 275 case PS_TYPE_S64: 289 SORT_INDICES(S64 );276 SORT_INDICES(S64,/* no absfcn needed */,1); 290 277 break; 291 278 case PS_TYPE_F32: 292 SORT_INDICES(F32 );279 SORT_INDICES(F32,fabsf,FLT_EPSILON); 293 280 break; 294 281 case PS_TYPE_F64: 295 SORT_INDICES(F64); 282 SORT_INDICES(F64,fabs,DBL_EPSILON); 283 break; 284 case PS_TYPE_C32: 285 SORT_INDICES(F64,cabsf,FLT_EPSILON); 286 break; 287 case PS_TYPE_C64: 288 SORT_INDICES(F64,cabs,DBL_EPSILON); 296 289 break; 297 290 default: 298 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 291 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSortIndex", 292 PS_ERR_BAD_PARAMETER_TYPE, true, 293 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 294 inType); 299 295 } 300 296 … … 304 300 return outVector; 305 301 } 306 307 static void vectorFree(psVector* restrict psVec)308 {309 if (psVec == NULL) {310 return;311 }312 313 psFree(psVec->data.V);314 } -
trunk/psLib/src/mathtypes/psScalar.c
r1648 r1807 1 2 1 /** @file psScalar.c 3 2 * … … 9 8 * @author Ross Harman, MHPCC 10 9 * 11 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-27 23:34:05$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-09-14 20:01:52 $ 13 12 * 14 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 15 14 */ 16 15 17 /******************************************************************************/18 19 /* INCLUDE FILES */20 21 /******************************************************************************/22 16 #include "psMemory.h" 23 17 #include "psError.h" … … 26 20 #include "psAbort.h" 27 21 28 /******************************************************************************/ 22 #include "psCollectionsErrors.h" 29 23 30 /* DEFINE STATEMENTS */31 32 /******************************************************************************/33 34 // None35 36 /******************************************************************************/37 38 /* TYPE DEFINITIONS */39 40 /******************************************************************************/41 42 // None43 44 /*****************************************************************************/45 46 /* GLOBAL VARIABLES */47 48 /*****************************************************************************/49 50 // None51 52 /*****************************************************************************/53 54 /* FILE STATIC VARIABLES */55 56 /*****************************************************************************/57 58 // None59 60 /*****************************************************************************/61 62 /* FUNCTION IMPLEMENTATION - LOCAL */63 64 /*****************************************************************************/65 66 // None67 68 /*****************************************************************************/69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */71 72 /*****************************************************************************/73 24 psScalar* psScalarAlloc(psC64 value, psElemType dataType) 74 25 { … … 77 28 // Create scalar 78 29 scalar = (psScalar* ) psAlloc(sizeof(psScalar)); 79 if (scalar == NULL) {80 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);81 }82 30 83 31 scalar->type.dimen = PS_DIMEN_SCALAR; … … 122 70 break; 123 71 default: 124 psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType); 72 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarAlloc", 73 PS_ERR_BAD_PARAMETER_TYPE, true, 74 PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE, 75 dataType); 125 76 } 126 77 … … 134 85 135 86 if (scalar == NULL) { 136 psError(__func__, "Null scalar not allowed"); 87 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy", 88 PS_ERR_BAD_PARAMETER_NULL, true, 89 PS_ERRORTEXT_psScalar_COPY_NULL); 90 return NULL; 137 91 } 138 92 … … 176 130 break; 177 131 default: 178 psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType); 132 psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy", 133 PS_ERR_BAD_PARAMETER_TYPE, true, 134 PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE, 135 dataType); 179 136 } 180 137 -
trunk/psLib/src/mathtypes/psVector.c
r1761 r1807 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 09 21:59:03$12 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-14 20:01:52 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psLogMsg.h" 26 26 #include "psCompare.h" 27 27 28 #include "psCollectionsErrors.h" 28 29 29 30 static void vectorFree(psVector* restrict psVec); 31 32 33 static void vectorFree(psVector* restrict psVec) 34 { 35 if (psVec == NULL) { 36 return; 37 } 38 39 psFree(psVec->data.V); 40 } 30 41 31 42 // FUNCTION IMPLEMENTATION - PUBLIC … … 35 46 psVector* psVec = NULL; 36 47 int elementSize = 0; 37 38 // Invalid nalloc39 if (nalloc < 1) {40 psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);41 return NULL;42 }43 48 44 49 elementSize = PSELEMTYPE_SIZEOF(elemType); … … 64 69 psElemType elemType; 65 70 66 // Invalid nalloc67 if (nalloc < 1) {68 psError(__func__, "Invalid value for realloc (%d)\n", nalloc);69 return NULL;70 }71 72 71 if (in == NULL) { 73 psError(__func__, "Null input vector\n"); 72 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorRealloc", 73 PS_ERR_BAD_PARAMETER_NULL, true, 74 PS_ERRORTEXT_psVector_REALLOC_NULL); 74 75 return NULL; 75 76 } else if (in->nalloc != nalloc) { // No need to realloc to same size … … 101 102 return in; 102 103 } 103 // Invalid nalloc104 if (nalloc < 1) {105 psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);106 psFree(in);107 return NULL;108 }109 104 110 105 in->data.V = psRealloc(in->data.V, nalloc * PSELEMTYPE_SIZEOF(type)); … … 119 114 psVector* psVectorSort(psVector* restrict outVector, const psVector* restrict inVector) 120 115 { 121 int inN = 0; 122 int outN = 0; 116 int N = 0; 123 117 int elSize = 0; 124 118 void *inVec = NULL; … … 127 121 128 122 if (inVector == NULL) { 129 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 130 return outVector; 123 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSort", 124 PS_ERR_BAD_PARAMETER_NULL, true, 125 PS_ERRORTEXT_psVector_SORT_NULL); 126 psFree(outVector); 127 return NULL; 131 128 } 132 129 133 130 inType = inVector->type.type; 134 inN = inVector->n;131 N = inVector->n; 135 132 inVec = inVector->data.V; 136 133 elSize = PSELEMTYPE_SIZEOF(inType); 137 134 138 135 if (outVector == NULL) { 139 outVector = psVectorAlloc(inN, inType); 140 outVector->n = inVector->n; 141 } 142 143 outN = outVector->n; 136 outVector = psVectorAlloc(N, inType); 137 } 138 139 // check to see if output vector needs to be resized/retyped 140 if ( (N > outVector->nalloc) || 141 (inType != outVector->type.type) ) { 142 // reshape the output vector to match the input vector's size/type. 143 outVector = psVectorRecycle(outVector,N,inType); 144 } 145 outVector->n = N; 144 146 outVec = outVector->data.V; 145 147 146 if (inN != outN) { 147 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", 148 __LINE__, inN, outN); 148 if (N == 0) { 149 // no need to sort anything, as there are no elements in input vector. 149 150 return outVector; 150 151 } 151 152 152 if (inType != outVector->type.type) { 153 psError(__func__, " : Line %d - Input and output vectors are not same type: in=%d out=%d\n", __LINE__, 154 inType, outVector->type.type); 155 return outVector; 156 } 157 158 if (inN == 0) { 159 psError(__func__, " : Line %d - No elements in use for input vector\n", __LINE__); 160 return outVector; 161 } 162 163 if (outN == 0) { 164 psError(__func__, " : Line %d - No elements in use for output vector\n", __LINE__); 165 return outVector; 166 } 167 // Copy input vector values into output vector 168 memcpy(outVec, inVec, elSize * outN); 153 // Copy input vector values into output vector if not in-place sorting 154 if (inVector != outVector) { 155 memcpy(outVec, inVec, elSize * N); 156 } 169 157 170 158 // Sort output vector 171 159 switch (inType) { 172 160 case PS_TYPE_U8: 173 qsort(outVec, inN, elSize, psCompareU8);161 qsort(outVec, N, elSize, psCompareU8); 174 162 break; 175 163 case PS_TYPE_U16: 176 qsort(outVec, inN, elSize, psCompareU16);164 qsort(outVec, N, elSize, psCompareU16); 177 165 break; 178 166 case PS_TYPE_U32: 179 qsort(outVec, inN, elSize, psCompareU32);167 qsort(outVec, N, elSize, psCompareU32); 180 168 break; 181 169 case PS_TYPE_U64: 182 qsort(outVec, inN, elSize, psCompareU64);170 qsort(outVec, N, elSize, psCompareU64); 183 171 break; 184 172 case PS_TYPE_S8: 185 qsort(outVec, inN, elSize, psCompareS8);173 qsort(outVec, N, elSize, psCompareS8); 186 174 break; 187 175 case PS_TYPE_S16: 188 qsort(outVec, inN, elSize, psCompareS16);176 qsort(outVec, N, elSize, psCompareS16); 189 177 break; 190 178 case PS_TYPE_S32: 191 qsort(outVec, inN, elSize, psCompareS32);179 qsort(outVec, N, elSize, psCompareS32); 192 180 break; 193 181 case PS_TYPE_S64: 194 qsort(outVec, inN, elSize, psCompareS64);182 qsort(outVec, N, elSize, psCompareS64); 195 183 break; 196 184 case PS_TYPE_F32: 197 qsort(outVec, inN, elSize, psCompareF32);185 qsort(outVec, N, elSize, psCompareF32); 198 186 break; 199 187 case PS_TYPE_F64: 200 qsort(outVec, inN, elSize, psCompareF64);188 qsort(outVec, N, elSize, psCompareF64); 201 189 break; 202 190 default: 203 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 191 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSort", 192 PS_ERR_BAD_PARAMETER_TYPE, true, 193 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 194 inType); 204 195 } 205 196 … … 207 198 } 208 199 209 #define SORT_INDICES(TYPE) \210 for(i=0; i<inN; i++) { \211 for(j=0; j<inN; j++) { \212 diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]); \213 if(diff < FLT_EPSILON) { \214 outVec[i] = j; \215 break; \216 } \217 } \218 }219 220 200 psVector* psVectorSortIndex(psVector* restrict outVector, const psVector* restrict inVector) 221 201 { 222 int inN = 0; 223 int outN = 0; 224 int i = 0; 225 int j = 0; 226 float *inVec = NULL; 227 int *outVec = NULL; 228 double diff = 0.0f; 202 int N = 0; 229 203 psVector* tmpVector = NULL; 230 204 psElemType inType = 0; 205 psU32* outVec; 231 206 232 207 if (inVector == NULL) { 233 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 208 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSortIndex", 209 PS_ERR_BAD_PARAMETER_NULL, true, 210 PS_ERRORTEXT_psVector_SORT_NULL); 211 psFree(outVector); 212 return NULL; 213 } 214 215 N = inVector->n; 216 217 if (outVector == NULL) { 218 outVector = psVectorAlloc(N, PS_TYPE_U32); 219 } 220 221 // check to see if output vector needs to be resized/retyped 222 if ( (N > outVector->nalloc) || 223 (outVector->type.type != PS_TYPE_U32) ) { 224 // reshape the output vector to match the input vector's size/type. 225 outVector = psVectorRecycle(outVector,N,PS_TYPE_U32); 226 } 227 outVector->n = N; 228 outVec = outVector->data.U32; 229 230 if (N == 0) { 231 // no need to sort anything, as there are no elements in input vector. 234 232 return outVector; 235 233 } 236 234 237 inN = inVector->n;238 inVec = inVector->data.V;239 inType = inVector->type.type;240 241 if (outVector == NULL) {242 outVector = psVectorAlloc(inN, PS_TYPE_U32);243 outVector->n = inN;244 }245 246 outN = outVector->n;247 outVec = outVector->data.V;248 249 if (inN != outN) {250 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n",251 __LINE__, inN, outN);252 return outVector;253 }254 255 if (outVector->type.type != PS_TYPE_U32) {256 psError(__func__, " : Line %d - Output vector is not of type U32: out=%d\n",257 __LINE__, outVector->type.type);258 return outVector;259 }260 261 tmpVector = psVectorAlloc(inN, inType);262 tmpVector->n = inN;263 235 tmpVector = psVectorSort(tmpVector, inVector); 236 237 #define SORT_INDICES(TYPE,absfcn,maxError) { \ 238 ps##TYPE* inVec = inVector->data.TYPE; \ 239 ps##TYPE* tmpVec = tmpVector->data.TYPE; \ 240 ps##TYPE diff; \ 241 for(int i=0; i<N; i++) { \ 242 for(int j=0; j<N; j++) { \ 243 diff = absfcn(tmpVec[i] - inVec[j]); \ 244 if(diff < maxError) { \ 245 outVec[i] = j; \ 246 break; \ 247 } \ 248 } \ 249 } \ 250 } 264 251 265 252 // Sort output vector 266 253 switch (inType) { 267 254 case PS_TYPE_U8: 268 SORT_INDICES(U8 );255 SORT_INDICES(U8,/* no absfcn needed */,1); 269 256 break; 270 257 case PS_TYPE_U16: 271 SORT_INDICES(U16 );258 SORT_INDICES(U16,/* no absfcn needed */,1); 272 259 break; 273 260 case PS_TYPE_U32: 274 SORT_INDICES(U32 );261 SORT_INDICES(U32,/* no absfcn needed */,1); 275 262 break; 276 263 case PS_TYPE_U64: 277 SORT_INDICES(U64 );264 SORT_INDICES(U64,/* no absfcn needed */,1); 278 265 break; 279 266 case PS_TYPE_S8: 280 SORT_INDICES(S8 );267 SORT_INDICES(S8,/* no absfcn needed */,1); 281 268 break; 282 269 case PS_TYPE_S16: 283 SORT_INDICES(S16 );270 SORT_INDICES(S16,/* no absfcn needed */,1); 284 271 break; 285 272 case PS_TYPE_S32: 286 SORT_INDICES(S32 );273 SORT_INDICES(S32,/* no absfcn needed */,1); 287 274 break; 288 275 case PS_TYPE_S64: 289 SORT_INDICES(S64 );276 SORT_INDICES(S64,/* no absfcn needed */,1); 290 277 break; 291 278 case PS_TYPE_F32: 292 SORT_INDICES(F32 );279 SORT_INDICES(F32,fabsf,FLT_EPSILON); 293 280 break; 294 281 case PS_TYPE_F64: 295 SORT_INDICES(F64); 282 SORT_INDICES(F64,fabs,DBL_EPSILON); 283 break; 284 case PS_TYPE_C32: 285 SORT_INDICES(F64,cabsf,FLT_EPSILON); 286 break; 287 case PS_TYPE_C64: 288 SORT_INDICES(F64,cabs,DBL_EPSILON); 296 289 break; 297 290 default: 298 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 291 psErrorMsg(PS_ERRORNAME_DOMAIN "psVectorSortIndex", 292 PS_ERR_BAD_PARAMETER_TYPE, true, 293 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 294 inType); 299 295 } 300 296 … … 304 300 return outVector; 305 301 } 306 307 static void vectorFree(psVector* restrict psVec)308 {309 if (psVec == NULL) {310 return;311 }312 313 psFree(psVec->data.V);314 } -
trunk/psLib/src/parseErrorCodes.pl
r1748 r1807 34 34 } 35 35 else { 36 /^\s*(\w+)\s+([\%\w].*)/; 37 my $ErrorCode = $1; 38 my $ErrorDescription = $2; 39 print " $ErrorCode: '$ErrorDescription'\n" if $verbose; 40 push( @ErrorCodes, $ErrorCode ); 41 push( @ErrorDescriptions, $ErrorDescription ); 42 36 if (/^\s*(\w+)\s+([\%\w].*)/) { 37 my $ErrorCode = $1; 38 my $ErrorDescription = $2; 39 print " $ErrorCode: '$ErrorDescription'\n" if $verbose; 40 push( @ErrorCodes, $ErrorCode ); 41 push( @ErrorDescriptions, $ErrorDescription ); 42 } else { 43 print "I $_\n" if $verbose; 44 } 43 45 } 44 46 } -
trunk/psLib/src/psErrorCodes.dat
r1764 r1807 13 13 MEMORY_DEREF_USAGE dereferenced memory still used 14 14 BAD_PARAMETER_VALUE parameter is out-of-range 15 BAD_PARAMETER_TYPE parameter is of unsupported data-type 15 16 BAD_PARAMETER_NULL parameter is null 16 BAD_PARAMETER_ LENGTH parameter string is too long17 BAD_PARAMETER_SIZE size of parameter's data is outside of acceptable range. 17 18 UNEXPECTED_NULL unexpected NULL found -
trunk/psLib/src/sys/psError.c
r1696 r1807 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 07 19:05:07$12 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-14 20:01:52 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 va_list argPtr; // variable list arguement pointer 97 97 98 // Get the variable list parameters to pass to logging function99 va_start(argPtr, fmt);100 101 // Call logging function with PS_LOG_ERROR level102 psLogMsgV(name, PS_LOG_ERROR, fmt, argPtr);103 104 98 if (new) { 105 99 psErrorClear(); 106 100 } 107 101 102 // Get the variable list parameters to pass to logging function 103 va_start(argPtr, fmt); 104 108 105 vsnprintf(errMsg,1024,fmt,argPtr); 109 106 err = psErrAlloc(name,code,errMsg); 110 107 pushErrorStack(err); 108 109 // Call logging function with PS_LOG_ERROR level 110 psLogMsg(name, PS_LOG_ERROR, errMsg); 111 111 112 112 // Clean up stack after variable argument has been used … … 116 116 } 117 117 118 constpsErr* psErrorGet(int which)118 psErr* psErrorGet(int which) 119 119 { 120 120 psErr* result; … … 134 134 } 135 135 136 constpsErr* psErrorLast(void)136 psErr* psErrorLast(void) 137 137 { 138 138 return psErrorGet(0); -
trunk/psLib/src/sys/psError.h
r1783 r1807 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09-1 0 23:20:35$14 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-14 20:01:52 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 * @return Error message object at 'which' 51 51 */ 52 constpsErr* psErrorGet(52 psErr* psErrorGet( 53 53 int which ///< position in the error stack. 0 is last error on stack. 54 54 ); … … 61 61 * @return psErr* Reference to last error message on error stack 62 62 */ 63 constpsErr* psErrorLast(void);63 psErr* psErrorLast(void); 64 64 65 65 /** Clears the error stack. -
trunk/psLib/src/sys/psErrorCodes.c
r1787 r1807 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-1 1 00:43:54$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-14 20:01:52 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 39 39 {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"}, 40 {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported data-type"}, 40 41 {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"}, 41 {PS_ERR_BAD_PARAMETER_ LENGTH,"parameter string is too long"},42 {PS_ERR_BAD_PARAMETER_SIZE,"size of parameter's data is outside of acceptable range."}, 42 43 {PS_ERR_UNEXPECTED_NULL,"unexpected NULL foun"}, 43 44 //~End -
trunk/psLib/src/sys/psErrorCodes.h
r1787 r1807 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-1 1 00:43:54$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-14 20:01:52 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 48 48 PS_ERR_BAD_PARAMETER_VALUE, ///< parameter is out-of-range 49 PS_ERR_BAD_PARAMETER_TYPE, ///< parameter is of unsupported data-type 49 50 PS_ERR_BAD_PARAMETER_NULL, ///< parameter is null 50 PS_ERR_BAD_PARAMETER_ LENGTH, ///< parameter string is too long51 PS_ERR_BAD_PARAMETER_SIZE, ///< size of parameter's data is outside of acceptable range. 51 52 PS_ERR_UNEXPECTED_NULL, ///< unexpected NULL foun 52 53 //~End -
trunk/psLib/src/sys/psLogMsg.c
r1798 r1807 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-1 1 03:03:36$13 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 383 383 va_end(ap); 384 384 } 385 void psWarning(const char* name, const char* fmt, ...) 386 { 387 va_list ap; 388 389 va_start(ap, fmt); 390 psLogMsgV(name, PS_LOG_WARN, fmt, ap); 391 va_end(ap); 392 } -
trunk/psLib/src/sys/psLogMsg.h
r1798 r1807 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-1 1 03:03:36$13 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 }; 100 100 101 /** Logs a warning message. 102 * 103 * This procedure logs a message to the destination set by a prior 104 * call to psLogSetDestination(), This is equivalent to calling 105 * psLogMsg with a level of PS_LOG_WARN. 106 * 107 */ 108 void psWarning( 109 const char* name, 110 const char* fmt, 111 ... 112 ); 113 101 114 /// @} 102 115 -
trunk/psLib/src/sysUtils/psError.c
r1696 r1807 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-09- 07 19:05:07$12 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-14 20:01:52 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 va_list argPtr; // variable list arguement pointer 97 97 98 // Get the variable list parameters to pass to logging function99 va_start(argPtr, fmt);100 101 // Call logging function with PS_LOG_ERROR level102 psLogMsgV(name, PS_LOG_ERROR, fmt, argPtr);103 104 98 if (new) { 105 99 psErrorClear(); 106 100 } 107 101 102 // Get the variable list parameters to pass to logging function 103 va_start(argPtr, fmt); 104 108 105 vsnprintf(errMsg,1024,fmt,argPtr); 109 106 err = psErrAlloc(name,code,errMsg); 110 107 pushErrorStack(err); 108 109 // Call logging function with PS_LOG_ERROR level 110 psLogMsg(name, PS_LOG_ERROR, errMsg); 111 111 112 112 // Clean up stack after variable argument has been used … … 116 116 } 117 117 118 constpsErr* psErrorGet(int which)118 psErr* psErrorGet(int which) 119 119 { 120 120 psErr* result; … … 134 134 } 135 135 136 constpsErr* psErrorLast(void)136 psErr* psErrorLast(void) 137 137 { 138 138 return psErrorGet(0); -
trunk/psLib/src/sysUtils/psError.h
r1783 r1807 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-09-1 0 23:20:35$14 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-14 20:01:52 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 * @return Error message object at 'which' 51 51 */ 52 constpsErr* psErrorGet(52 psErr* psErrorGet( 53 53 int which ///< position in the error stack. 0 is last error on stack. 54 54 ); … … 61 61 * @return psErr* Reference to last error message on error stack 62 62 */ 63 constpsErr* psErrorLast(void);63 psErr* psErrorLast(void); 64 64 65 65 /** Clears the error stack. -
trunk/psLib/src/sysUtils/psErrorCodes.c
r1787 r1807 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-1 1 00:43:54$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-14 20:01:52 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 39 39 {PS_ERR_BAD_PARAMETER_VALUE,"parameter is out-of-range"}, 40 {PS_ERR_BAD_PARAMETER_TYPE,"parameter is of unsupported data-type"}, 40 41 {PS_ERR_BAD_PARAMETER_NULL,"parameter is null"}, 41 {PS_ERR_BAD_PARAMETER_ LENGTH,"parameter string is too long"},42 {PS_ERR_BAD_PARAMETER_SIZE,"size of parameter's data is outside of acceptable range."}, 42 43 {PS_ERR_UNEXPECTED_NULL,"unexpected NULL foun"}, 43 44 //~End -
trunk/psLib/src/sysUtils/psErrorCodes.h
r1787 r1807 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-1 1 00:43:54$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-14 20:01:52 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 48 48 PS_ERR_BAD_PARAMETER_VALUE, ///< parameter is out-of-range 49 PS_ERR_BAD_PARAMETER_TYPE, ///< parameter is of unsupported data-type 49 50 PS_ERR_BAD_PARAMETER_NULL, ///< parameter is null 50 PS_ERR_BAD_PARAMETER_ LENGTH, ///< parameter string is too long51 PS_ERR_BAD_PARAMETER_SIZE, ///< size of parameter's data is outside of acceptable range. 51 52 PS_ERR_UNEXPECTED_NULL, ///< unexpected NULL foun 52 53 //~End -
trunk/psLib/src/sysUtils/psLogMsg.c
r1798 r1807 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-1 1 03:03:36$13 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 383 383 va_end(ap); 384 384 } 385 void psWarning(const char* name, const char* fmt, ...) 386 { 387 va_list ap; 388 389 va_start(ap, fmt); 390 psLogMsgV(name, PS_LOG_WARN, fmt, ap); 391 va_end(ap); 392 } -
trunk/psLib/src/sysUtils/psLogMsg.h
r1798 r1807 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-1 1 03:03:36$13 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 }; 100 100 101 /** Logs a warning message. 102 * 103 * This procedure logs a message to the destination set by a prior 104 * call to psLogSetDestination(), This is equivalent to calling 105 * psLogMsg with a level of PS_LOG_WARN. 106 * 107 */ 108 void psWarning( 109 const char* name, 110 const char* fmt, 111 ... 112 ); 113 101 114 /// @} 102 115 -
trunk/psLib/src/types/psArray.c
r1651 r1807 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-27 23:54:33$11 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-14 20:01:52 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psArray.h" 27 27 #include "psLogMsg.h" 28 29 #include "psCollectionsErrors.h" 28 30 29 31 /*****************************************************************************/ … … 43 45 psArray* psArr = NULL; 44 46 45 // Invalid nalloc46 if (nalloc < 1) {47 psError(__func__, "Invalid value for nalloc. nalloc: %d\n", nalloc);48 return NULL;49 }50 47 // Create vector struct 51 48 psArr = (psArray* ) psAlloc(sizeof(psArray)); … … 63 60 psArray* psArrayRealloc(unsigned int nalloc, psArray* restrict in) 64 61 { 65 // Invalid nalloc66 if (nalloc < 1) {67 psError(__func__, "Invalid value for realloc (%d)\n", nalloc);68 return NULL;69 }70 71 62 if (in == NULL) { 72 63 return psArrayAlloc(nalloc); -
trunk/psLib/src/types/psBitSet.c
r1440 r1807 1 2 1 /** @file psBitSet.c 3 2 * … … 10 9 * 11 10 * @author Ross Harman, MHPCC 12 * 13 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-09 23:34:57 $ 11 * @author Robert DeSonia, MHPCC 12 * 13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-09-14 20:01:52 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 17 17 */ 18 18 19 /******************************************************************************/20 21 /* INCLUDE FILES */22 23 /******************************************************************************/24 19 #include <string.h> 25 20 #include <stdio.h> … … 32 27 #include "psError.h" 33 28 #include "psAbort.h" 34 35 /******************************************************************************/ 36 37 /* DEFINE STATEMENTS */ 38 39 /******************************************************************************/ 40 41 // None 42 43 /******************************************************************************/ 44 45 /* TYPE DEFINITIONS */ 46 47 /******************************************************************************/ 48 49 // None 50 51 /*****************************************************************************/ 52 53 /* GLOBAL VARIABLES */ 54 55 /*****************************************************************************/ 56 57 // None 58 59 /*****************************************************************************/ 60 61 /* FILE STATIC VARIABLES */ 62 63 /*****************************************************************************/ 64 65 // None 66 67 /*****************************************************************************/ 68 69 /* FUNCTION IMPLEMENTATION - LOCAL */ 70 71 /*****************************************************************************/ 72 static void psBitSetFree(psBitSet* restrict inBitSet); 29 #include "psString.h" 30 31 #include "psCollectionsErrors.h" 32 33 enum { 34 UNKNOWN_OP, 35 AND_OP, 36 OR_OP, 37 XOR_OP, 38 NOT_OP 39 }; 40 41 static void bitSetFree(psBitSet* restrict inBitSet); 73 42 74 43 /** Private function to create a mask. … … 90 59 } 91 60 92 /*****************************************************************************/ 93 94 /* FUNCTION IMPLEMENTATION - PUBLIC */ 95 96 /*****************************************************************************/ 61 static void bitSetFree(psBitSet* restrict inBitSet) 62 { 63 if (inBitSet == NULL) { 64 return; 65 } 66 psFree(inBitSet->bits); 67 } 68 97 69 psBitSet* psBitSetAlloc(int n) 98 70 { … … 100 72 psBitSet* newObj = NULL; 101 73 102 if (n <= 0) { 103 psError(__func__, " : Line %d - Allocation size must be > 0: size = %d", __LINE__, n); 104 return 0; 74 if (n < 0) { 75 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetAlloc", 76 PS_ERR_BAD_PARAMETER_VALUE, true, 77 PS_ERRORTEXT_psBitSet_ALLOC_NEG_SIZE, 78 n); 79 return NULL; 105 80 } 106 81 107 82 numBytes = ceil(n / 8.0); 108 83 newObj = psAlloc(sizeof(psBitSet)); 109 if (newObj == NULL) { 110 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__); 111 } 112 p_psMemSetDeallocator(newObj, (psFreeFcn) psBitSetFree); 84 p_psMemSetDeallocator(newObj, (psFreeFcn) bitSetFree); 113 85 newObj->n = numBytes; 114 86 … … 116 88 /* @i@ */ 117 89 newObj->bits = psAlloc(sizeof(char) * numBytes); 118 if (newObj->bits == NULL) { 119 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__); 120 } 121 122 memset(newObj->bits, numBytes, 0); 90 91 memset(newObj->bits, 0, numBytes); 123 92 124 93 return newObj; 125 94 } 126 95 127 static void psBitSetFree(psBitSet* restrict inBitSet)128 {129 if (inBitSet == NULL) {130 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__);131 return;132 }133 psFree(inBitSet->bits);134 }135 136 96 psBitSet* psBitSetSet(psBitSet* inBitSet, int bit) 137 97 { … … 139 99 140 100 if (inBitSet == NULL) { 141 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 101 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetSet", 102 PS_ERR_BAD_PARAMETER_NULL, true, 103 PS_ERRORTEXT_psBitSet_SET_NULL); 142 104 return inBitSet; 143 } else if (bit < 0) { 144 psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit); 145 return inBitSet; 146 } else if (bit > inBitSet->n * 8 - 1) { 147 psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit); 105 } else if ( (bit < 0) || 106 (bit > inBitSet->n * 8 - 1) ) { 107 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetSet", 108 PS_ERR_BAD_PARAMETER_VALUE, true, 109 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 110 bit,inBitSet->n * 8 - 1); 148 111 return inBitSet; 149 112 } … … 155 118 } 156 119 120 psBitSet* psBitSetClear(psBitSet* inBitSet, int bit) 121 { 122 char *byte = NULL; 123 124 if (inBitSet == NULL) { 125 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetClear", 126 PS_ERR_BAD_PARAMETER_NULL, true, 127 PS_ERRORTEXT_psBitSet_SET_NULL); 128 return inBitSet; 129 } else if ( (bit < 0) || 130 (bit > inBitSet->n * 8 - 1) ) { 131 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetClear", 132 PS_ERR_BAD_PARAMETER_VALUE, true, 133 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 134 bit,inBitSet->n * 8 - 1); 135 return inBitSet; 136 } 137 // Variable byte is the byte in the array that contains the bit to be set 138 byte = inBitSet->bits + bit / 8; 139 *byte &= ! mask(bit); 140 141 return inBitSet; 142 } 143 157 144 bool psBitSetTest(const psBitSet* inBitSet, int bit) 158 145 { … … 160 147 161 148 if (inBitSet == NULL) { 162 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 163 return 0; 164 } else if (bit < 0) { 165 psError(__func__, " : Line %d - Bit position too small: %d", __LINE__, bit); 166 return 0; 167 } else if (bit > inBitSet->n * 8 - 1) { 168 psError(__func__, " : Line %d - Bit position too large: %d", __LINE__, bit); 169 return 0; 170 } 149 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetTest", 150 PS_ERR_BAD_PARAMETER_NULL, true, 151 PS_ERRORTEXT_psBitSet_SET_NULL); 152 return false; 153 } else if ( (bit < 0) || 154 (bit > inBitSet->n * 8 - 1) ) { 155 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetTest", 156 PS_ERR_BAD_PARAMETER_VALUE, true, 157 PS_ERRORTEXT_psBitSet_BIT_OUTOFRANGE, 158 bit,inBitSet->n * 8 - 1); 159 return false; 160 } 161 171 162 // Variable byte is the byte in the array that contains the bit to be tested 172 163 byte = inBitSet->bits + bit / 8; 173 if ((int)(*byte & mask(bit)) == 0) { 174 return 0; 175 } 176 177 return 1; 164 return ((*byte & mask(bit)) != 0); 178 165 } 179 166 … … 183 170 int i = 0; 184 171 int n = 0; 185 char tempChar = '0';186 char *outBits= NULL;187 char *inBits1= NULL;188 char *inBits2 = NULL;172 char* outBits = NULL; 173 char* inBits1 = NULL; 174 char* inBits2 = NULL; 175 int op = UNKNOWN_OP; 189 176 190 177 if (inBitSet1 == NULL) { 191 psError(__func__, " : Line %d - Null psBitSet for inBitSet1 argument", __LINE__); 192 return outBitSet; 193 } 178 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 179 PS_ERR_BAD_PARAMETER_NULL, true, 180 PS_ERRORTEXT_psBitSet_FIRST_OPERAND_NULL); 181 psFree(outBitSet); 182 return NULL; 183 } 184 inBits1 = inBitSet1->bits; 194 185 195 186 if (operator == NULL) { 196 psError(__func__, " : Line %d - Null input operator\n", __LINE__); 197 return outBitSet; 198 } 199 200 if (inBitSet2 == NULL) { 201 psError(__func__, " : Line %d - Null psBitSet for inBitSet2 argument", __LINE__); 202 return outBitSet; 187 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 188 PS_ERR_BAD_PARAMETER_NULL, true, 189 PS_ERRORTEXT_psBitSet_OPERATOR_NULL); 190 psFree(outBitSet); 191 return NULL; 192 } 193 194 // make operator all caps 195 int tempStrLen = strlen(operator); 196 char* tempStr = psAlloc(tempStrLen+1); 197 198 for (int lcv=0;lcv<tempStrLen;lcv++) { 199 tempStr[lcv] = (char)toupper(operator[lcv]); 200 } 201 tempStr[tempStrLen] = '\0'; 202 203 // parse the operator 204 if (strcmp(operator,"AND")==0) { 205 op = AND_OP; 206 } else if (strcmp(operator,"OR")==0) { 207 op = OR_OP; 208 } else if (strcmp(operator,"XOR")==0) { 209 op = XOR_OP; 210 } else if (strcmp(operator,"NOT")==0) { 211 op = NOT_OP; 212 } else { 213 psFree(tempStr); 214 psFree(outBitSet); 215 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 216 PS_ERR_BAD_PARAMETER_VALUE, true, 217 PS_ERRORTEXT_psBitSet_OPERATOR_INVALID, 218 operator); 219 return NULL; 220 } 221 psFree(tempStr); 222 223 if (op != NOT_OP) { 224 if (inBitSet2 == NULL) { 225 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 226 PS_ERR_BAD_PARAMETER_NULL, true, 227 PS_ERRORTEXT_psBitSet_SECOND_OPERAND_NULL); 228 psFree(outBitSet); 229 return NULL; 230 } 231 232 if (inBitSet1->n != inBitSet2->n) { 233 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetOp", 234 PS_ERR_BAD_PARAMETER_SIZE, true, 235 PS_ERRORTEXT_psBitSet_OPERANDS_SIZE_DIFFER); 236 psFree(outBitSet); 237 return NULL; 238 } 239 inBits2 = inBitSet2->bits; 203 240 } 204 241 205 242 if (outBitSet == NULL) { 206 outBitSet = psBitSetAlloc(inBitSet1->n * 8); 207 } 208 209 if (inBitSet1->n != inBitSet2->n || outBitSet->n != inBitSet1->n) { 210 psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__); 211 return outBitSet; 243 outBitSet = psBitSetAlloc(inBitSet1->n*8); 244 } else if (outBitSet->n != inBitSet1->n) { 245 outBitSet->n = inBitSet1->n; 246 outBitSet->bits = psRealloc(outBitSet->bits, inBitSet1->n); 212 247 } 213 248 214 249 n = outBitSet->n; 215 250 outBits = outBitSet->bits; 216 inBits1 = inBitSet1->bits; 217 inBits2 = inBitSet2->bits; 218 219 tempChar = toupper(operator[0]); 220 switch (tempChar) { 221 case 'A': 251 252 switch (op) { 253 case AND_OP: 222 254 for (i = 0; i < n; i++) { 223 255 outBits[i] = inBits1[i] & inBits2[i]; 224 256 } 225 257 break; 226 case 'O':258 case OR_OP: 227 259 for (i = 0; i < n; i++) { 228 260 outBits[i] = inBits1[i] | inBits2[i]; 229 261 } 230 262 break; 231 case 'X':263 case XOR_OP: 232 264 for (i = 0; i < n; i++) { 233 265 outBits[i] = inBits1[i] ^ inBits2[i]; 234 266 } 235 267 break; 268 case NOT_OP: 269 for (i = 0; i < n; i++) { 270 outBits[i] = ~inBits1[i]; 271 } 272 break; 236 273 default: 237 psError(__func__, " : Line %d - Invalid psBitMask binary operation: %s", __LINE__, operator); 274 psAbort(PS_ERRORNAME_DOMAIN "psBitSetOp", 275 "Unexpected error - operator parsed successfully but not valid?"); 238 276 } 239 277 … … 243 281 psBitSet* psBitSetNot(psBitSet* outBitSet, const psBitSet* restrict inBitSet) 244 282 { 245 int i = 0; 246 int n = 0; 247 char *outBits = NULL; 248 char *inBits = NULL; 249 250 if (inBitSet == NULL) { 251 psError(__func__, " : Line %d - Null psBitSet for inBitSet argument", __LINE__); 252 return outBitSet; 253 } 254 255 n = inBitSet->n; 256 if (n == 0) { 257 psError(__func__, " : Line %d - No elements in inBitSet", __LINE__); 258 return outBitSet; 259 } 283 if (inBitSet == NULL) { 284 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetNot", 285 PS_ERR_BAD_PARAMETER_NULL, true, 286 PS_ERRORTEXT_psBitSet_OPERAND_NULL); 287 psFree(outBitSet); 288 return NULL; 289 } 290 291 outBitSet = psBitSetOp(outBitSet,inBitSet,"NOT",NULL); 260 292 261 293 if (outBitSet == NULL) { 262 outBitSet = psBitSetAlloc(n * 8); 263 } 264 265 if (inBitSet->n != outBitSet->n) { 266 psError(__func__, " : Line %d - psBitSet sizes not the same", __LINE__); 267 return outBitSet; 268 } 269 270 outBits = outBitSet->bits; 271 inBits = inBitSet->bits; 272 273 for (i = 0; i < n; i++) { 274 outBits[i] = ~inBits[i]; 294 psErrorMsg(PS_ERRORNAME_DOMAIN "psBitSetNot", 295 PS_ERR_UNKNOWN, false, 296 PS_ERRORTEXT_psBitSet_NOT_OP_FAILED); 275 297 } 276 298 … … 284 306 char *outString = psAlloc((size_t) numBits + 1); 285 307 286 if (outString == NULL) {287 psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);288 }289 290 308 for (i = 0; i < numBits; i++) { 291 outString[numBits - i - 1] = (psBitSetTest(inBitSet, i) == 1) ? '1' : '0';309 outString[numBits - i - 1] = psBitSetTest(inBitSet, i) ? '1' : '0'; 292 310 } 293 311 -
trunk/psLib/src/types/psBitSet.h
r1472 r1807 1 2 1 /** @file psBitSet.h 3 2 * … … 13 12 * @author Ross Harman, MHPCC 14 13 * 15 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 8-11 19:53:33$14 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-14 20:01:52 $ 17 16 * 18 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 25 27 26 /******************************************************************************/ 28 29 27 /* TYPE DEFINITIONS */ 30 31 28 /******************************************************************************/ 32 29 … … 44 41 45 42 /*****************************************************************************/ 46 47 43 /* FUNCTION PROTOTYPES */ 48 49 44 /*****************************************************************************/ 50 45 … … 64 59 /** Set a bit. 65 60 * 66 * Sets a bit at a given bit location , either one or zero. The bit is set based on a zero index with the61 * Sets a bit at a given bit location. The bit is set based on a zero index with the 67 62 * first bit set in the zero bit slot of the zero element of the byte array. As an example, setting bit 3 in 68 63 * an array with two elements would result in an psBitSet that looks like 00000000 00001000. … … 74 69 psBitSet* restrict inMask, ///< Pointer to psBitSet to be set. 75 70 int bit ///< Bit to be set. 71 ); 72 73 /** Clear a bit. 74 * 75 * Clear a bit at a given bit location. The bit is cleared based on a zero 76 * index with the first bit set in the zero bit slot of the zero element of 77 * the byte array. 78 * 79 * @return psBitSet* : Pointer to struct containing psBitSet. 80 */ 81 psBitSet* psBitSetClear( 82 /* @returned@ */ 83 psBitSet* restrict inMask, ///< Pointer to psBitSet to be cleared. 84 int bit ///< Bit to be cleared. 76 85 ); 77 86 -
trunk/psLib/src/types/psList.c
r1747 r1807 1 2 1 /** @file psList.c 3 2 * @brief Support for doubly linked lists … … 7 6 * @author Robert Daniel DeSonia, MHPCC 8 7 * 9 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09- 09 02:23:27$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-14 20:01:52 $ 11 10 * 12 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 23 #include "psTrace.h" 25 24 #include "psLogMsg.h" 25 26 #include "psCollectionsErrors.h" 26 27 27 28 #define ITER_INIT_HEAD ((void *)1) // next iteration should return head -
trunk/psLib/test/collections/Makefile
r1421 r1807 3 3 ## Makefile: test/collections 4 4 ## 5 ## $Revision: 1.2 2$ $Name: not supported by cvs2svn $6 ## $Date: 2004-0 8-09 20:42:24$5 ## $Revision: 1.23 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-09-14 20:01:52 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 TARGET = tst_psVector \ 22 22 tst_psArray \ 23 tst_psBitSet_01 \ 24 tst_psBitSet_02 \ 25 tst_psBitSet_03 \ 26 tst_psBitSet_04 \ 27 tst_psBitSet_05 \ 28 tst_psBitSet_06 \ 29 tst_psBitSet_07 \ 30 tst_psBitSet_08 \ 23 tst_psBitSet \ 31 24 tst_psVectorSort_01 \ 32 25 tst_psVectorSort_02 \ -
trunk/psLib/test/collections/verified/tst_psVector.stderr
r1761 r1807 1 1 <DATE><TIME>|<HOST>|I|main 2 2 Following should be an error message. 3 <DATE><TIME>|<HOST>|E|psVectorAlloc4 Invalid value for nalloc. nalloc: 05 3 <DATE><TIME>|<HOST>|I|main 6 4 Following should be an error message. 7 <DATE><TIME>|<HOST>|E|ps VectorRealloc8 Null input vector5 <DATE><TIME>|<HOST>|E|psLib.collections.psVectorRealloc 6 psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. -
trunk/psLib/test/collections/verified/tst_psVectorSort_02.stderr
r1304 r1807 1 <DATE><TIME>|<HOST>|E|psLib.collections.psVectorSortIndex 2 Input psVector is an unsupported type (0). -
trunk/psLib/test/collections/verified/tst_psVectorSort_02.stdout
r1304 r1807 19 19 \**********************************************************************************/ 20 20 21 arr[0] = 322 arr[1] = 223 arr[2] = 421 arr[0] = 0 22 arr[1] = 0 23 arr[2] = 0 24 24 arr[3] = 0 25 arr[4] = 125 arr[4] = 0 26 26 27 27 ---> TESTPOINT PASSED (psVectorSortIndex{Create sorted index vector} | tst_psVectorSort_02.c) … … 42 42 \**********************************************************************************/ 43 43 44 file:line ID 45 psError.c:<LINENO> 9 46 psError.c:<LINENO> 8 47 psError.c:<LINENO> 7 48 ERROR: Found 3 memory leaks 44 49 45 50 ---> TESTPOINT PASSED (psVectorSort{Free vectors} | tst_psVectorSort_02.c) -
trunk/psLib/test/collections/verified/tst_psVectorSort_03.stderr
r1761 r1807 1 <DATE><TIME>|<HOST>|E|psVectorSort2 : Line <LINENO> - Input and output vector sizes are not equal: in=5 out=63 <DATE><TIME>|<HOST>|E|psVectorSort4 : Line <LINENO> - Input and output vectors are not same type: in=1028 out=1032 -
trunk/psLib/test/collections/verified/tst_psVectorSort_04.stderr
r1761 r1807 1 <DATE><TIME>|<HOST>|E|ps VectorSort2 : Line <LINENO> - Null input vector1 <DATE><TIME>|<HOST>|E|psLib.collections.psVectorSort 2 psVectorSort can not sort a NULL psVector. -
trunk/psLib/test/collections/verified/tst_psVectorSort_04.stdout
r1233 r1807 16 16 \**********************************************************************************/ 17 17 18 file:line ID 19 psError.c:<LINENO> 5 20 psError.c:<LINENO> 4 21 psError.c:<LINENO> 3 22 ERROR: Found 3 memory blocks 18 23 19 24 ---> TESTPOINT PASSED (psVectorSort{Free arays} | tst_psVectorSort_04.c)
Note:
See TracChangeset
for help on using the changeset viewer.
