Changeset 1233
- Timestamp:
- Jul 15, 2004, 1:52:34 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 17 added
- 7 deleted
- 25 edited
-
src/collections/Makefile (modified) (2 diffs)
-
src/collections/psSort.c (deleted)
-
src/collections/psSort.d (deleted)
-
src/collections/psSort.h (deleted)
-
src/collections/psVector.c (modified) (3 diffs)
-
src/collections/psVector.d (modified) (1 diff)
-
src/collections/psVector.h (modified) (2 diffs)
-
src/dataManip/psFunctions.c (modified) (2 diffs)
-
src/dataManip/psFunctions.d (modified) (1 diff)
-
src/dataManip/psMinimize.c (modified) (2 diffs)
-
src/dataManip/psMinimize.d (modified) (1 diff)
-
src/dataManip/psStats.c (modified) (3 diffs)
-
src/dataManip/psStats.d (modified) (1 diff)
-
src/image/psImageStats.c (modified) (1 diff)
-
src/image/psImageStats.d (modified) (1 diff)
-
src/imageops/psImageStats.c (modified) (1 diff)
-
src/math/psMinimize.c (modified) (2 diffs)
-
src/math/psPolynomial.c (modified) (2 diffs)
-
src/math/psSpline.c (modified) (2 diffs)
-
src/math/psStats.c (modified) (3 diffs)
-
src/mathtypes/psVector.c (modified) (3 diffs)
-
src/mathtypes/psVector.h (modified) (2 diffs)
-
src/pslib.h (modified) (2 diffs)
-
src/sys/psMemory.c (modified) (2 diffs)
-
src/sys/psMemory.h (modified) (3 diffs)
-
src/sysUtils/psMemory.c (modified) (2 diffs)
-
src/sysUtils/psMemory.h (modified) (3 diffs)
-
test/collections/Makefile (modified) (2 diffs)
-
test/collections/tst_psSort_01.c (deleted)
-
test/collections/tst_psSort_02.c (deleted)
-
test/collections/tst_psSort_03.c (deleted)
-
test/collections/tst_psSort_04.c (deleted)
-
test/collections/tst_psVector.c (added)
-
test/collections/tst_psVectorSort_01 (added)
-
test/collections/tst_psVectorSort_01.c (added)
-
test/collections/tst_psVectorSort_01.c~ (added)
-
test/collections/tst_psVectorSort_02 (added)
-
test/collections/tst_psVectorSort_02.c (added)
-
test/collections/tst_psVectorSort_02.c~ (added)
-
test/collections/tst_psVectorSort_03 (added)
-
test/collections/tst_psVectorSort_03.c (added)
-
test/collections/tst_psVectorSort_03.c~ (added)
-
test/collections/tst_psVectorSort_04 (added)
-
test/collections/tst_psVectorSort_04.c (added)
-
test/collections/tst_psVectorSort_04.c~ (added)
-
test/collections/verified/tst_psVectorSort_03.stderr (added)
-
test/collections/verified/tst_psVectorSort_03.stdout (added)
-
test/collections/verified/tst_psVectorSort_04.stderr (added)
-
test/collections/verified/tst_psVectorSort_04.stdout (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/Makefile
r1228 r1233 3 3 ## Makefile: collections 4 4 ## 5 ## $Revision: 1.2 4$ $Name: not supported by cvs2svn $6 ## $Date: 2004-07-15 2 2:18:02$5 ## $Revision: 1.25 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-07-15 23:52:33 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 SRC_OBJS = psBitSet.o \ 33 33 psVector.o \ 34 psSort.o \35 34 psImage.o \ 36 35 psList.o \ -
trunk/psLib/src/collections/psVector.c
r1228 r1233 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-07-15 2 2:18:02$10 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-15 23:52:33 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 17 17 /* INCLUDE FILES */ 18 18 /******************************************************************************/ 19 #include <string.h> // for memcpy 20 #include <stdlib.h> 21 #include <math.h> 22 19 23 #include "psMemory.h" 20 24 #include "psError.h" 21 25 #include "psVector.h" 22 26 #include "psLogMsg.h" 27 #include "psCompare.h" 23 28 24 29 /******************************************************************************/ … … 143 148 } 144 149 150 psVector *psVectorSort(psVector *restrict outVector, const psVector *restrict inVector) 151 { 152 int inN = 0; 153 int outN = 0; 154 int elSize = 0; 155 void *inVec = NULL; 156 void *outVec = NULL; 157 psElemType inType = 0; 158 159 if(inVector == NULL) { 160 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 161 return outVector; 162 } 163 164 inType = inVector->type.type; 165 inN = inVector->n; 166 inVec = inVector->data.V; 167 elSize = PSELEMTYPE_SIZEOF(inType); 168 169 if(outVector == NULL) { 170 outVector = psVectorAlloc(inN, inType); 171 outVector->n = inVector->n; 172 } 173 174 outN = outVector->n; 175 outVec = outVector->data.V; 176 177 if(inN != outN) { 178 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", __LINE__, 179 inN, outN); 180 return outVector; 181 } 182 183 if(inN == 0) { 184 psError(__func__, " : Line %d - No elements in use for input vector\n", __LINE__); 185 return outVector; 186 } 187 188 if(outN == 0) { 189 psError(__func__, " : Line %d - No elements in use for output vector\n", __LINE__); 190 return outVector; 191 } 192 193 // Copy input vector values into output vector 194 memcpy(outVec, inVec, elSize*outN); 195 196 // Sort output vector 197 switch(inType) { 198 case PS_TYPE_U8: 199 qsort(outVec, inN, elSize, psCompareU8); 200 break; 201 case PS_TYPE_U16: 202 qsort(outVec, inN, elSize, psCompareU16); 203 break; 204 case PS_TYPE_U32: 205 qsort(outVec, inN, elSize, psCompareU32); 206 break; 207 case PS_TYPE_U64: 208 qsort(outVec, inN, elSize, psCompareU64); 209 break; 210 case PS_TYPE_S8: 211 qsort(outVec, inN, elSize, psCompareS8); 212 break; 213 case PS_TYPE_S16: 214 qsort(outVec, inN, elSize, psCompareS16); 215 break; 216 case PS_TYPE_S32: 217 qsort(outVec, inN, elSize, psCompareS32); 218 break; 219 case PS_TYPE_S64: 220 qsort(outVec, inN, elSize, psCompareS64); 221 break; 222 case PS_TYPE_F32: 223 qsort(outVec, inN, elSize, psCompareF32); 224 break; 225 case PS_TYPE_F64: 226 qsort(outVec, inN, elSize, psCompareF64); 227 break; 228 default: 229 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 230 } 231 232 return outVector; 233 } 234 235 #define SORT_INDICES(TYPE) \ 236 for(i=0; i<inN; i++) { \ 237 for(j=0; j<inN; j++) { \ 238 diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]); \ 239 if(diff < FLT_EPSILON) { \ 240 outVec[i] = j; \ 241 break; \ 242 } \ 243 } \ 244 } 245 246 psVector *psVectorSortIndex(psVector *restrict outVector, const psVector *restrict inVector) 247 { 248 int inN = 0; 249 int outN = 0; 250 int i = 0; 251 int j = 0; 252 float *inVec = NULL; 253 int *outVec = NULL; 254 double diff = 0.0f; 255 psVector *tmpVector = NULL; 256 psElemType inType = 0; 257 258 if(inVector == NULL) { 259 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 260 return outVector; 261 } 262 263 inN = inVector->n; 264 inVec = inVector->data.V; 265 inType = inVector->type.type; 266 267 if(outVector == NULL) { 268 outVector = psVectorAlloc(inN, PS_TYPE_U32); 269 outVector->n = inN; 270 } 271 272 outN = outVector->n; 273 outVec = outVector->data.V; 274 275 if(inN != outN) { 276 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", 277 __LINE__, inN, outN); 278 return outVector; 279 } 280 281 tmpVector = psVectorAlloc(inN, inType); 282 tmpVector->n = inN; 283 tmpVector = psVectorSort(tmpVector, inVector); 284 285 // Sort output vector 286 switch(inType) { 287 case PS_TYPE_U8: 288 SORT_INDICES(U8); 289 break; 290 case PS_TYPE_U16: 291 SORT_INDICES(U16); 292 break; 293 case PS_TYPE_U32: 294 SORT_INDICES(U32); 295 break; 296 case PS_TYPE_U64: 297 SORT_INDICES(U64); 298 break; 299 case PS_TYPE_S8: 300 SORT_INDICES(S8); 301 break; 302 case PS_TYPE_S16: 303 SORT_INDICES(S16); 304 break; 305 case PS_TYPE_S32: 306 SORT_INDICES(S32); 307 break; 308 case PS_TYPE_S64: 309 SORT_INDICES(S64); 310 break; 311 case PS_TYPE_F32: 312 SORT_INDICES(F32); 313 break; 314 case PS_TYPE_F64: 315 SORT_INDICES(F64); 316 break; 317 default: 318 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 319 } 320 321 // Free temp memory 322 psFree(tmpVector); 323 324 return outVector; 325 } 326 145 327 static void vectorFree(psVector *restrict psVec) 146 328 { -
trunk/psLib/src/collections/psVector.d
r986 r1233 1 1 psVector.o psVector.d : psVector.c ../sysUtils/psMemory.h ../sysUtils/psError.h \ 2 psVector.h psType.h ../sysUtils/psLogMsg.h 2 psVector.h psType.h ../sysUtils/psLogMsg.h psCompare.h -
trunk/psLib/src/collections/psVector.h
r1228 r1233 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-07-15 2 2:18:02$13 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-07-15 23:52:33 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 ); 100 100 101 /** Sort an array of floats. 102 * 103 * Sorts an array of floats in ascending order. This function is valid for 104 * all non-complex data types. 105 * 106 * @return psFloatArray*: Pointer to sorted psFloatArray. 107 */ 108 109 psVector *psVectorSort( 110 psVector *restrict outVector, ///< the output vector to recycle, or NULL if new vector desired. 111 const psVector *restrict inVector ///< the vector to sort. 112 ); 113 114 /** Creates an array of indices based on sort odred of float array. 115 * 116 * Sorts an array of floats and creates an integer array holding indices of 117 * sorted float values based on pre-sort index positions. 118 * 119 * @return psIntArray*: Pointer to psIntArray of sorted indices. 120 */ 121 122 psVector *psVectorSortIndex( 123 psVector *restrict outVector, 124 const psVector *restrict inVector 125 ); 126 127 101 128 /// @} 102 129 -
trunk/psLib/src/dataManip/psFunctions.c
r1073 r1233 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-0 6-23 23:00:15$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-07-15 23:52:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psAbort.h" 29 29 #include "psFunctions.h" 30 #include "psSort.h"31 30 32 31 #include "float.h" -
trunk/psLib/src/dataManip/psFunctions.d
r986 r1233 1 1 psFunctions.o psFunctions.d : psFunctions.c ../sysUtils/psMemory.h \ 2 2 ../collections/psVector.h ../collections/psType.h ../sysUtils/psTrace.h \ 3 ../sysUtils/psError.h ../sysUtils/psAbort.h psFunctions.h \ 4 ../collections/psSort.h 3 ../sysUtils/psError.h ../sysUtils/psAbort.h psFunctions.h -
trunk/psLib/src/dataManip/psMinimize.c
r1199 r1233 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-07- 08 20:50:46$11 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-07-15 23:52:34 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 #include "psAbort.h" 39 39 #include "psFunctions.h" 40 #include "psSort.h"41 40 #include "psMinimize.h" 42 41 #include "psMatrix.h" -
trunk/psLib/src/dataManip/psMinimize.d
r1190 r1233 2 2 ../collections/psVector.h ../collections/psType.h \ 3 3 ../collections/psImage.h ../sysUtils/psTrace.h ../sysUtils/psError.h \ 4 ../sysUtils/psAbort.h psFunctions.h ../collections/psSort.h \ 5 psMinimize.h psMatrix.h 4 ../sysUtils/psAbort.h psFunctions.h psMinimize.h psMatrix.h -
trunk/psLib/src/dataManip/psStats.c
r1073 r1233 12 12 #include "psAbort.h" 13 13 #include "psStats.h" 14 #include "psSort.h"15 14 16 15 #include "float.h" … … 672 671 } 673 672 // Sort the temporary vectors. 674 ps Sort(sortedVector, unsortedVector);673 psVectorSort(sortedVector, unsortedVector); 675 674 676 675 // Calculate the median exactly. … … 828 827 829 828 // Sort the temporary vectors. 830 ps Sort(sortedVector, unsortedVector);829 psVectorSort(sortedVector, unsortedVector); 831 830 832 831 // Calculate the quartile points exactly. -
trunk/psLib/src/dataManip/psStats.d
r986 r1233 1 1 psStats.o psStats.d : psStats.c ../sysUtils/psMemory.h ../collections/psVector.h \ 2 2 ../collections/psType.h ../sysUtils/psTrace.h ../sysUtils/psError.h \ 3 ../sysUtils/psAbort.h psStats.h ../collections/psSort.h3 ../sysUtils/psAbort.h psStats.h -
trunk/psLib/src/image/psImageStats.c
r1078 r1233 11 11 #include "psAbort.h" 12 12 #include "psStats.h" 13 #include "psSort.h"14 13 #include "psImage.h" 15 14 #include "psFunctions.h" -
trunk/psLib/src/image/psImageStats.d
r986 r1233 2 2 ../collections/psVector.h ../collections/psType.h ../sysUtils/psTrace.h \ 3 3 ../sysUtils/psError.h ../sysUtils/psAbort.h psStats.h \ 4 ../collections/ps Sort.h ../collections/psImage.h psFunctions.h4 ../collections/psImage.h psFunctions.h -
trunk/psLib/src/imageops/psImageStats.c
r1078 r1233 11 11 #include "psAbort.h" 12 12 #include "psStats.h" 13 #include "psSort.h"14 13 #include "psImage.h" 15 14 #include "psFunctions.h" -
trunk/psLib/src/math/psMinimize.c
r1199 r1233 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-07- 08 20:50:46$11 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-07-15 23:52:34 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 #include "psAbort.h" 39 39 #include "psFunctions.h" 40 #include "psSort.h"41 40 #include "psMinimize.h" 42 41 #include "psMatrix.h" -
trunk/psLib/src/math/psPolynomial.c
r1073 r1233 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-0 6-23 23:00:15$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-07-15 23:52:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psAbort.h" 29 29 #include "psFunctions.h" 30 #include "psSort.h"31 30 32 31 #include "float.h" -
trunk/psLib/src/math/psSpline.c
r1073 r1233 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-0 6-23 23:00:15$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-07-15 23:52:34 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psAbort.h" 29 29 #include "psFunctions.h" 30 #include "psSort.h"31 30 32 31 #include "float.h" -
trunk/psLib/src/math/psStats.c
r1073 r1233 12 12 #include "psAbort.h" 13 13 #include "psStats.h" 14 #include "psSort.h"15 14 16 15 #include "float.h" … … 672 671 } 673 672 // Sort the temporary vectors. 674 ps Sort(sortedVector, unsortedVector);673 psVectorSort(sortedVector, unsortedVector); 675 674 676 675 // Calculate the median exactly. … … 828 827 829 828 // Sort the temporary vectors. 830 ps Sort(sortedVector, unsortedVector);829 psVectorSort(sortedVector, unsortedVector); 831 830 832 831 // Calculate the quartile points exactly. -
trunk/psLib/src/mathtypes/psVector.c
r1228 r1233 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-07-15 2 2:18:02$10 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-15 23:52:33 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 17 17 /* INCLUDE FILES */ 18 18 /******************************************************************************/ 19 #include <string.h> // for memcpy 20 #include <stdlib.h> 21 #include <math.h> 22 19 23 #include "psMemory.h" 20 24 #include "psError.h" 21 25 #include "psVector.h" 22 26 #include "psLogMsg.h" 27 #include "psCompare.h" 23 28 24 29 /******************************************************************************/ … … 143 148 } 144 149 150 psVector *psVectorSort(psVector *restrict outVector, const psVector *restrict inVector) 151 { 152 int inN = 0; 153 int outN = 0; 154 int elSize = 0; 155 void *inVec = NULL; 156 void *outVec = NULL; 157 psElemType inType = 0; 158 159 if(inVector == NULL) { 160 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 161 return outVector; 162 } 163 164 inType = inVector->type.type; 165 inN = inVector->n; 166 inVec = inVector->data.V; 167 elSize = PSELEMTYPE_SIZEOF(inType); 168 169 if(outVector == NULL) { 170 outVector = psVectorAlloc(inN, inType); 171 outVector->n = inVector->n; 172 } 173 174 outN = outVector->n; 175 outVec = outVector->data.V; 176 177 if(inN != outN) { 178 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", __LINE__, 179 inN, outN); 180 return outVector; 181 } 182 183 if(inN == 0) { 184 psError(__func__, " : Line %d - No elements in use for input vector\n", __LINE__); 185 return outVector; 186 } 187 188 if(outN == 0) { 189 psError(__func__, " : Line %d - No elements in use for output vector\n", __LINE__); 190 return outVector; 191 } 192 193 // Copy input vector values into output vector 194 memcpy(outVec, inVec, elSize*outN); 195 196 // Sort output vector 197 switch(inType) { 198 case PS_TYPE_U8: 199 qsort(outVec, inN, elSize, psCompareU8); 200 break; 201 case PS_TYPE_U16: 202 qsort(outVec, inN, elSize, psCompareU16); 203 break; 204 case PS_TYPE_U32: 205 qsort(outVec, inN, elSize, psCompareU32); 206 break; 207 case PS_TYPE_U64: 208 qsort(outVec, inN, elSize, psCompareU64); 209 break; 210 case PS_TYPE_S8: 211 qsort(outVec, inN, elSize, psCompareS8); 212 break; 213 case PS_TYPE_S16: 214 qsort(outVec, inN, elSize, psCompareS16); 215 break; 216 case PS_TYPE_S32: 217 qsort(outVec, inN, elSize, psCompareS32); 218 break; 219 case PS_TYPE_S64: 220 qsort(outVec, inN, elSize, psCompareS64); 221 break; 222 case PS_TYPE_F32: 223 qsort(outVec, inN, elSize, psCompareF32); 224 break; 225 case PS_TYPE_F64: 226 qsort(outVec, inN, elSize, psCompareF64); 227 break; 228 default: 229 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 230 } 231 232 return outVector; 233 } 234 235 #define SORT_INDICES(TYPE) \ 236 for(i=0; i<inN; i++) { \ 237 for(j=0; j<inN; j++) { \ 238 diff = fabs((double)tmpVector->data.TYPE[i] - inVec[j]); \ 239 if(diff < FLT_EPSILON) { \ 240 outVec[i] = j; \ 241 break; \ 242 } \ 243 } \ 244 } 245 246 psVector *psVectorSortIndex(psVector *restrict outVector, const psVector *restrict inVector) 247 { 248 int inN = 0; 249 int outN = 0; 250 int i = 0; 251 int j = 0; 252 float *inVec = NULL; 253 int *outVec = NULL; 254 double diff = 0.0f; 255 psVector *tmpVector = NULL; 256 psElemType inType = 0; 257 258 if(inVector == NULL) { 259 psError(__func__, " : Line %d - Null input vector\n", __LINE__); 260 return outVector; 261 } 262 263 inN = inVector->n; 264 inVec = inVector->data.V; 265 inType = inVector->type.type; 266 267 if(outVector == NULL) { 268 outVector = psVectorAlloc(inN, PS_TYPE_U32); 269 outVector->n = inN; 270 } 271 272 outN = outVector->n; 273 outVec = outVector->data.V; 274 275 if(inN != outN) { 276 psError(__func__, " : Line %d - Input and output vector sizes are not equal: in=%d out=%d\n", 277 __LINE__, inN, outN); 278 return outVector; 279 } 280 281 tmpVector = psVectorAlloc(inN, inType); 282 tmpVector->n = inN; 283 tmpVector = psVectorSort(tmpVector, inVector); 284 285 // Sort output vector 286 switch(inType) { 287 case PS_TYPE_U8: 288 SORT_INDICES(U8); 289 break; 290 case PS_TYPE_U16: 291 SORT_INDICES(U16); 292 break; 293 case PS_TYPE_U32: 294 SORT_INDICES(U32); 295 break; 296 case PS_TYPE_U64: 297 SORT_INDICES(U64); 298 break; 299 case PS_TYPE_S8: 300 SORT_INDICES(S8); 301 break; 302 case PS_TYPE_S16: 303 SORT_INDICES(S16); 304 break; 305 case PS_TYPE_S32: 306 SORT_INDICES(S32); 307 break; 308 case PS_TYPE_S64: 309 SORT_INDICES(S64); 310 break; 311 case PS_TYPE_F32: 312 SORT_INDICES(F32); 313 break; 314 case PS_TYPE_F64: 315 SORT_INDICES(F64); 316 break; 317 default: 318 psError(__func__, " : Line %d - Invalid psType\n", __LINE__); 319 } 320 321 // Free temp memory 322 psFree(tmpVector); 323 324 return outVector; 325 } 326 145 327 static void vectorFree(psVector *restrict psVec) 146 328 { -
trunk/psLib/src/mathtypes/psVector.h
r1228 r1233 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-07-15 2 2:18:02$13 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-07-15 23:52:33 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 ); 100 100 101 /** Sort an array of floats. 102 * 103 * Sorts an array of floats in ascending order. This function is valid for 104 * all non-complex data types. 105 * 106 * @return psFloatArray*: Pointer to sorted psFloatArray. 107 */ 108 109 psVector *psVectorSort( 110 psVector *restrict outVector, ///< the output vector to recycle, or NULL if new vector desired. 111 const psVector *restrict inVector ///< the vector to sort. 112 ); 113 114 /** Creates an array of indices based on sort odred of float array. 115 * 116 * Sorts an array of floats and creates an integer array holding indices of 117 * sorted float values based on pre-sort index positions. 118 * 119 * @return psIntArray*: Pointer to psIntArray of sorted indices. 120 */ 121 122 psVector *psVectorSortIndex( 123 psVector *restrict outVector, 124 const psVector *restrict inVector 125 ); 126 127 101 128 /// @} 102 129 -
trunk/psLib/src/pslib.h
r1228 r1233 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-07-15 2 2:18:02$10 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-15 23:52:33 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 83 83 #include "psBitSet.h" 84 84 85 /// @defgroup Sort Sorting Functions86 /// @ingroup DataContainer87 #include "psSort.h"88 /// @}89 90 85 // Data Manipulation 91 86 /// @defgroup DataManip Data Manipulation -
trunk/psLib/src/sys/psMemory.c
r1204 r1233 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-07- 09 02:45:42$10 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-15 23:52:34 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 214 214 } 215 215 216 int psMemCheckCorruption( intabort_on_error)216 int psMemCheckCorruption(bool abort_on_error) 217 217 { 218 218 int nbad = 0; // number of bad blocks -
trunk/psLib/src/sys/psMemory.h
r1204 r1233 14 14 * @ingroup MemoryManagement 15 15 * 16 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-07- 09 02:45:42$16 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-07-15 23:52:34 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 22 22 #include <stdio.h> // needed for FILE 23 #include <stdbool.h> 23 24 #include <pthread.h> // we need a mutex to make this stuff thread safe. 24 25 … … 208 209 */ 209 210 int psMemCheckCorruption( 210 intabort_on_error ///< Abort on detecting corruption?211 bool abort_on_error ///< Abort on detecting corruption? 211 212 ); 212 213 -
trunk/psLib/src/sysUtils/psMemory.c
r1204 r1233 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-07- 09 02:45:42$10 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-07-15 23:52:34 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 214 214 } 215 215 216 int psMemCheckCorruption( intabort_on_error)216 int psMemCheckCorruption(bool abort_on_error) 217 217 { 218 218 int nbad = 0; // number of bad blocks -
trunk/psLib/src/sysUtils/psMemory.h
r1204 r1233 14 14 * @ingroup MemoryManagement 15 15 * 16 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-07- 09 02:45:42$16 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-07-15 23:52:34 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 22 22 #include <stdio.h> // needed for FILE 23 #include <stdbool.h> 23 24 #include <pthread.h> // we need a mutex to make this stuff thread safe. 24 25 … … 208 209 */ 209 210 int psMemCheckCorruption( 210 intabort_on_error ///< Abort on detecting corruption?211 bool abort_on_error ///< Abort on detecting corruption? 211 212 ); 212 213 -
trunk/psLib/test/collections/Makefile
r1227 r1233 3 3 ## Makefile: test/collections 4 4 ## 5 ## $Revision: 1. 19$ $Name: not supported by cvs2svn $6 ## $Date: 2004-07-15 2 2:17:03$5 ## $Revision: 1.20 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-07-15 23:52:34 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 tst_psBitSet_07 \ 30 30 tst_psBitSet_08 \ 31 tst_ps Sort_01 \32 tst_ps Sort_02 \33 tst_ps Sort_03 \34 tst_ps Sort_04 \31 tst_psVectorSort_01 \ 32 tst_psVectorSort_02 \ 33 tst_psVectorSort_03 \ 34 tst_psVectorSort_04 \ 35 35 tst_psImage \ 36 36 tst_psList
Note:
See TracChangeset
for help on using the changeset viewer.
