IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4597


Ignore:
Timestamp:
Jul 22, 2005, 12:19:31 PM (21 years ago)
Author:
drobbin
Message:

* empty log message *

Location:
trunk/psLib/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/mathtypes/psVector.c

    r4540 r4597  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-07-12 19:12:01 $
     11*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-07-22 22:18:23 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3030typedef struct
    3131{
    32     p_psVectorData data; // need this first for psVectorSortIndex to work.
     32    union {
     33        psU8* U8;                      ///< Unsigned 8-bit integer data.
     34        psU16* U16;                    ///< Unsigned 16-bit integer data.
     35        psU32* U32;                    ///< Unsigned 32-bit integer data.
     36        psU64* U64;                    ///< Unsigned 64-bit integer data.
     37        psS8* S8;                      ///< Signed 8-bit integer data.
     38        psS16* S16;                    ///< Signed 16-bit integer data.
     39        psS32* S32;                    ///< Signed 32-bit integer data.
     40        psS64* S64;                    ///< Signed 64-bit integer data.
     41        psF32* F32;                    ///< Single-precision float data.
     42        psF64* F64;                    ///< Double-precision float data.
     43        psC32* C32;                    ///< Single-precision complex data.
     44        psC64* C64;                    ///< Double-precision complex data.
     45    } data;
    3346    psU32 index;
    3447}
     
    4861// FUNCTION IMPLEMENTATION - PUBLIC
    4962
    50 psVector* psVectorAlloc( long nalloc, psElemType type)
     63psVector* psVectorAlloc(long nalloc,
     64                        psElemType type)
    5165{
    5266    psVector* psVec = NULL;
     
    7690}
    7791
    78 psVector* psVectorRealloc(psVector* vector, long nalloc)
     92psVector* psVectorRealloc(psVector* vector,
     93                          long nalloc)
    7994{
    8095    psS32 elementSize = 0;
     
    99114}
    100115
    101 psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type)
     116psVector* psVectorRecycle(psVector* vector,
     117                          long nalloc,
     118                          psElemType type)
    102119{
    103120    psS32 byteSize;
     
    129146}
    130147
    131 psVector *psVectorExtend(psVector *vector, long delta, long nExtend)
     148psVector *psVectorExtend(psVector *vector,
     149                         long delta,
     150                         long nExtend)
    132151{
    133152    // can't handle a NULL vector (don't know the data type to allocate)
     
    166185}
    167186
    168 psVector* psVectorCopy(psVector* output, const psVector* input, psElemType type)
     187psVector* psVectorCopy(psVector* output,
     188                       const psVector* input,
     189                       psElemType type)
    169190{
    170191    if (input == NULL) {
     
    267288}
    268289
    269 psVector* psVectorSort(psVector* outVector, const psVector* inVector)
     290psVector* psVectorSort(psVector* outVector,
     291                       const psVector* inVector)
    270292{
    271293    psS32 N = 0;
     
    353375}
    354376
    355 psVector* psVectorSortIndex(psVector* outVector, const psVector* inVector)
     377psVector* psVectorSortIndex(psVector* outVector,
     378                            const psVector* inVector)
    356379{
    357380    psS32 N = 0;
     
    437460}
    438461
    439 char* psVectorToString(psVector* vector, int maxLength)
     462char* psVectorToString(psVector* vector,
     463                       int maxLength)
    440464{
    441465
     
    570594}
    571595
    572 bool p_psVectorPrint (FILE *f, psVector *a, char *name)
     596bool p_psVectorPrint (FILE *f,
     597                      psVector *a,
     598                      char *name)
    573599{
    574600
  • trunk/psLib/src/mathtypes/psVector.h

    r4540 r4597  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-12 19:12:01 $
     13 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-07-22 22:18:18 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828
    2929///< Union of psVector data types.
     30/*
    3031typedef union {
    3132    psU8* U8;                          ///< Unsigned 8-bit integer data.
     
    4344}
    4445p_psVectorData;
    45 
     46*/
    4647/** An vector to support primitive types.
    4748 *
     
    5455    long n;                            ///< Number of elements in use.
    5556    const long nalloc;                 ///< Total number of elements available.
    56     p_psVectorData data;               ///< Union for data types.
     57    union {
     58        psU8* U8;                      ///< Unsigned 8-bit integer data.
     59        psU16* U16;                    ///< Unsigned 16-bit integer data.
     60        psU32* U32;                    ///< Unsigned 32-bit integer data.
     61        psU64* U64;                    ///< Unsigned 64-bit integer data.
     62        psS8* S8;                      ///< Signed 8-bit integer data.
     63        psS16* S16;                    ///< Signed 16-bit integer data.
     64        psS32* S32;                    ///< Signed 32-bit integer data.
     65        psS64* S64;                    ///< Signed 64-bit integer data.
     66        psF32* F32;                    ///< Single-precision float data.
     67        psF64* F64;                    ///< Double-precision float data.
     68        psC32* C32;                    ///< Single-precision complex data.
     69        psC64* C64;                    ///< Double-precision complex data.
     70    } data;
    5771    void *lock;                        ///< Optional lock for thread safety.
    5872}
  • trunk/psLib/src/types/psArray.c

    r4556 r4597  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-07-15 02:33:54 $
     11 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-22 22:19:12 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5757    psMemSetDeallocator(psArr, (psFreeFunc) arrayFree);
    5858
    59     psArr->nalloc = nalloc;
     59    *(long*)&psArr->nalloc = nalloc;
    6060    psArr->n = nalloc;
    6161
     
    8080        // Realloc after decrementation to avoid accessing freed array elements
    8181        in->data = psRealloc(in->data, nalloc * sizeof(psPtr));
    82         in->nalloc = nalloc;
     82        *(long*)&in->nalloc = nalloc;
    8383    }
    8484
  • trunk/psLib/src/types/psArray.h

    r4556 r4597  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-15 02:33:54 $
     14 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-07-22 22:19:17 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3434typedef struct
    3535{
    36     long nalloc;                       ///< Total number of elements available.
    3736    long n;                            ///< Number of elements in use.
     37    const long nalloc;                 ///< Total number of elements available.
    3838    psPtr* data;                       ///< An Array of pointer elements
    3939    void *lock;                        ///< Optional lock for thread safety
  • trunk/psLib/src/types/psPixels.c

    r4556 r4597  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-15 02:33:54 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-22 22:19:27 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6565    }
    6666    out->n = nalloc;
    67     out->nalloc = nalloc;
     67    *(long*)&out->nalloc = nalloc;
    6868
    6969    psMemSetDeallocator(out, (psFreeFunc)pixelsFree);
     
    8585    }
    8686
    87     pixels->nalloc = nalloc;
     87    *(long*)&pixels->nalloc = nalloc;
    8888
    8989    if (pixels->n > pixels->nalloc) {
  • trunk/psLib/src/types/psPixels.h

    r4556 r4597  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-07-15 02:33:54 $
     9 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-07-22 22:19:31 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4242{
    4343    long n;                            ///< Number in usa
    44     long nalloc;                       ///< Number allocated
     44    const long nalloc;                 ///< Number allocated
    4545    psPixelCoord* data;                ///< The pixel coordinates
    4646    void *lock;                        ///< Option lock for thread safety
Note: See TracChangeset for help on using the changeset viewer.