IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1233


Ignore:
Timestamp:
Jul 15, 2004, 1:52:34 PM (22 years ago)
Author:
desonia
Message:

Changed psSort and psSortIndex to psVectorSort and psVectorSortIndex as well as added support for all non-complex datatypes.

Location:
trunk/psLib
Files:
17 added
7 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/Makefile

    r1228 r1233  
    33##  Makefile:   collections
    44##
    5 ##  $Revision: 1.24 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-07-15 22:18:02 $
     5##  $Revision: 1.25 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-07-15 23:52:33 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232SRC_OBJS = psBitSet.o \
    3333           psVector.o \
    34            psSort.o \
    3534           psImage.o \
    3635           psList.o \
  • trunk/psLib/src/collections/psVector.c

    r1228 r1233  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-07-15 22:18:02 $
     10 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-07-15 23:52:33 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1717/*  INCLUDE FILES                                                             */
    1818/******************************************************************************/
     19#include <string.h>        // for memcpy
     20#include <stdlib.h>
     21#include <math.h>
     22
    1923#include "psMemory.h"
    2024#include "psError.h"
    2125#include "psVector.h"
    2226#include "psLogMsg.h"
     27#include "psCompare.h"
    2328
    2429/******************************************************************************/
     
    143148}
    144149
     150psVector *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)                                                                                   \
     236for(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
     246psVector *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
    145327static void vectorFree(psVector *restrict psVec)
    146328{
  • trunk/psLib/src/collections/psVector.d

    r986 r1233  
    11psVector.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  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-07-15 22:18:02 $
     13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-07-15 23:52:33 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999);
    100100
     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
     109psVector *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
     122psVector *psVectorSortIndex(
     123    psVector *restrict outVector,
     124    const psVector *restrict inVector
     125);
     126
     127
    101128/// @}
    102129
  • trunk/psLib/src/dataManip/psFunctions.c

    r1073 r1233  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-23 23:00:15 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-07-15 23:52:34 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psAbort.h"
    2929#include "psFunctions.h"
    30 #include "psSort.h"
    3130
    3231#include "float.h"
  • trunk/psLib/src/dataManip/psFunctions.d

    r986 r1233  
    11psFunctions.o psFunctions.d : psFunctions.c ../sysUtils/psMemory.h \
    22  ../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  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.22 $ $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 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3838#include "psAbort.h"
    3939#include "psFunctions.h"
    40 #include "psSort.h"
    4140#include "psMinimize.h"
    4241#include "psMatrix.h"
  • trunk/psLib/src/dataManip/psMinimize.d

    r1190 r1233  
    22  ../collections/psVector.h ../collections/psType.h \
    33  ../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  
    1212#include "psAbort.h"
    1313#include "psStats.h"
    14 #include "psSort.h"
    1514
    1615#include "float.h"
     
    672671    }
    673672    // Sort the temporary vectors.
    674     psSort(sortedVector, unsortedVector);
     673    psVectorSort(sortedVector, unsortedVector);
    675674
    676675    // Calculate the median exactly.
     
    828827
    829828    // Sort the temporary vectors.
    830     psSort(sortedVector, unsortedVector);
     829    psVectorSort(sortedVector, unsortedVector);
    831830
    832831    // Calculate the quartile points exactly.
  • trunk/psLib/src/dataManip/psStats.d

    r986 r1233  
    11psStats.o psStats.d : psStats.c ../sysUtils/psMemory.h ../collections/psVector.h \
    22  ../collections/psType.h ../sysUtils/psTrace.h ../sysUtils/psError.h \
    3   ../sysUtils/psAbort.h psStats.h ../collections/psSort.h
     3  ../sysUtils/psAbort.h psStats.h
  • trunk/psLib/src/image/psImageStats.c

    r1078 r1233  
    1111#include "psAbort.h"
    1212#include "psStats.h"
    13 #include "psSort.h"
    1413#include "psImage.h"
    1514#include "psFunctions.h"
  • trunk/psLib/src/image/psImageStats.d

    r986 r1233  
    22  ../collections/psVector.h ../collections/psType.h ../sysUtils/psTrace.h \
    33  ../sysUtils/psError.h ../sysUtils/psAbort.h psStats.h \
    4   ../collections/psSort.h ../collections/psImage.h psFunctions.h
     4  ../collections/psImage.h psFunctions.h
  • trunk/psLib/src/imageops/psImageStats.c

    r1078 r1233  
    1111#include "psAbort.h"
    1212#include "psStats.h"
    13 #include "psSort.h"
    1413#include "psImage.h"
    1514#include "psFunctions.h"
  • trunk/psLib/src/math/psMinimize.c

    r1199 r1233  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.22 $ $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 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3838#include "psAbort.h"
    3939#include "psFunctions.h"
    40 #include "psSort.h"
    4140#include "psMinimize.h"
    4241#include "psMatrix.h"
  • trunk/psLib/src/math/psPolynomial.c

    r1073 r1233  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-23 23:00:15 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-07-15 23:52:34 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psAbort.h"
    2929#include "psFunctions.h"
    30 #include "psSort.h"
    3130
    3231#include "float.h"
  • trunk/psLib/src/math/psSpline.c

    r1073 r1233  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-23 23:00:15 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-07-15 23:52:34 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psAbort.h"
    2929#include "psFunctions.h"
    30 #include "psSort.h"
    3130
    3231#include "float.h"
  • trunk/psLib/src/math/psStats.c

    r1073 r1233  
    1212#include "psAbort.h"
    1313#include "psStats.h"
    14 #include "psSort.h"
    1514
    1615#include "float.h"
     
    672671    }
    673672    // Sort the temporary vectors.
    674     psSort(sortedVector, unsortedVector);
     673    psVectorSort(sortedVector, unsortedVector);
    675674
    676675    // Calculate the median exactly.
     
    828827
    829828    // Sort the temporary vectors.
    830     psSort(sortedVector, unsortedVector);
     829    psVectorSort(sortedVector, unsortedVector);
    831830
    832831    // Calculate the quartile points exactly.
  • trunk/psLib/src/mathtypes/psVector.c

    r1228 r1233  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-07-15 22:18:02 $
     10 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-07-15 23:52:33 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1717/*  INCLUDE FILES                                                             */
    1818/******************************************************************************/
     19#include <string.h>        // for memcpy
     20#include <stdlib.h>
     21#include <math.h>
     22
    1923#include "psMemory.h"
    2024#include "psError.h"
    2125#include "psVector.h"
    2226#include "psLogMsg.h"
     27#include "psCompare.h"
    2328
    2429/******************************************************************************/
     
    143148}
    144149
     150psVector *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)                                                                                   \
     236for(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
     246psVector *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
    145327static void vectorFree(psVector *restrict psVec)
    146328{
  • trunk/psLib/src/mathtypes/psVector.h

    r1228 r1233  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-07-15 22:18:02 $
     13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-07-15 23:52:33 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999);
    100100
     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
     109psVector *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
     122psVector *psVectorSortIndex(
     123    psVector *restrict outVector,
     124    const psVector *restrict inVector
     125);
     126
     127
    101128/// @}
    102129
  • trunk/psLib/src/pslib.h

    r1228 r1233  
    88 *  @author Eric Van Alst, MHPCC
    99 *   
    10  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-07-15 22:18:02 $
     10 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-07-15 23:52:33 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8383#include "psBitSet.h"
    8484
    85 /// @defgroup Sort Sorting Functions
    86 /// @ingroup DataContainer
    87 #include "psSort.h"
    88 /// @}
    89 
    9085// Data Manipulation
    9186/// @defgroup DataManip Data Manipulation
  • trunk/psLib/src/sys/psMemory.c

    r1204 r1233  
    88 *  @author Robert Lupton, Princeton University
    99 *
    10  *  @version $Revision: 1.27 $ $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 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    214214}
    215215
    216 int psMemCheckCorruption(int abort_on_error)
     216int psMemCheckCorruption(bool abort_on_error)
    217217{
    218218    int nbad = 0;                       // number of bad blocks
  • trunk/psLib/src/sys/psMemory.h

    r1204 r1233  
    1414 *  @ingroup MemoryManagement
    1515 *
    16  *  @version $Revision: 1.20 $ $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 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2121
    2222#include <stdio.h>                      // needed for FILE
     23#include <stdbool.h>
    2324#include <pthread.h>                    // we need a mutex to make this stuff thread safe.
    2425
     
    208209 */
    209210int psMemCheckCorruption(
    210     int abort_on_error              ///< Abort on detecting corruption?
     211    bool abort_on_error              ///< Abort on detecting corruption?
    211212);
    212213
  • trunk/psLib/src/sysUtils/psMemory.c

    r1204 r1233  
    88 *  @author Robert Lupton, Princeton University
    99 *
    10  *  @version $Revision: 1.27 $ $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 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    214214}
    215215
    216 int psMemCheckCorruption(int abort_on_error)
     216int psMemCheckCorruption(bool abort_on_error)
    217217{
    218218    int nbad = 0;                       // number of bad blocks
  • trunk/psLib/src/sysUtils/psMemory.h

    r1204 r1233  
    1414 *  @ingroup MemoryManagement
    1515 *
    16  *  @version $Revision: 1.20 $ $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 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2121
    2222#include <stdio.h>                      // needed for FILE
     23#include <stdbool.h>
    2324#include <pthread.h>                    // we need a mutex to make this stuff thread safe.
    2425
     
    208209 */
    209210int psMemCheckCorruption(
    210     int abort_on_error              ///< Abort on detecting corruption?
     211    bool abort_on_error              ///< Abort on detecting corruption?
    211212);
    212213
  • trunk/psLib/test/collections/Makefile

    r1227 r1233  
    33##  Makefile:   test/collections
    44##
    5 ##  $Revision: 1.19 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-07-15 22:17:03 $
     5##  $Revision: 1.20 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-07-15 23:52:34 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929         tst_psBitSet_07 \
    3030         tst_psBitSet_08 \
    31          tst_psSort_01   \
    32          tst_psSort_02   \
    33          tst_psSort_03   \
    34          tst_psSort_04   \
     31         tst_psVectorSort_01   \
     32         tst_psVectorSort_02   \
     33         tst_psVectorSort_03   \
     34         tst_psVectorSort_04   \
    3535         tst_psImage     \
    3636         tst_psList
Note: See TracChangeset for help on using the changeset viewer.