Changeset 7042
- Timestamp:
- May 2, 2006, 11:48:55 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/mathtypes/psVector.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psVector.c
r6977 r7042 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-0 4-25 03:30:29$11 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-05-02 21:48:55 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 403 403 #define PSVECTOR_SORT_INDEX_CASE(NAME) \ 404 404 case PS_TYPE_##NAME: { \ 405 ps U32 temp; \406 ps U32 *index = out->data.U32; \405 psS32 temp; \ 406 psS32 *index = out->data.S32; \ 407 407 ps##NAME *value = inVector->data.NAME; \ 408 408 for (;;) { \ … … 417 417 } \ 418 418 } \ 419 inti = l; \420 intj = (l << 1) + 1; \419 long i = l; \ 420 long j = (l << 1) + 1; \ 421 421 while (j <= ir) { \ 422 422 if (j < ir && value[index[j]] < value[index[j+1]]) \ 423 423 ++j; \ 424 if (value[temp ] < value[index[j]]) { \424 if (value[temp ] < value[index[j]]) { \ 425 425 index[i]=index[j]; \ 426 426 j += (i=j) + 1; \ … … 444 444 } 445 445 446 psVector *out = psVectorRecycle(outVector, inVector->n, PS_TYPE_ U32); // Vector for output447 out = psVectorCreate(out, 0, inVector->n, 1, PS_TYPE_ U32);446 psVector *out = psVectorRecycle(outVector, inVector->n, PS_TYPE_S32); // Vector for output 447 out = psVectorCreate(out, 0, inVector->n, 1, PS_TYPE_S32); 448 448 long N = out->n; // Number of elements 449 449 if (N < 2) { … … 452 452 long l = N >> 1; 453 453 long ir = N - 1; 454 switch ( out->type.type) {454 switch (inVector->type.type) { 455 455 PSVECTOR_SORT_INDEX_CASE(U8); 456 456 PSVECTOR_SORT_INDEX_CASE(U16);
Note:
See TracChangeset
for help on using the changeset viewer.
