IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 13, 2004, 9:28:35 AM (22 years ago)
Author:
desonia
Message:

changed the name of PS_TYPE* and updated the Vector struct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psVector.h

    r645 r661  
    1919 *  @author Ross Harman, MHPCC
    2020 *   
    21  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2004-05-12 18:07:22 $
     21 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2004-05-13 19:28:35 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747 */
    4848typedef enum {
    49     PS_TYPE_CHAR,       ///< Character.
    50     PS_TYPE_SHORT,      ///< Short integer.
    51     PS_TYPE_INT,        ///< Integer.
    52     PS_TYPE_LONG,       ///< Long integer.
    53     PS_TYPE_UCHAR,      ///< Unsigned character.
    54     PS_TYPE_USHORT,     ///< Unsigned short integer.
    55     PS_TYPE_UINT,       ///< Unsigned integer.
    56     PS_TYPE_ULONG,      ///< Unsigned long integer.
    57     PS_TYPE_FLOAT,      ///< Floating point.
    58     PS_TYPE_DOUBLE,     ///< Double-precision floating point.
    59     PS_TYPE_COMPLEX,    ///< Complex numbers consisting of floating point.
    60     PS_TYPE_OTHER,      ///< Something else that's not supported for arithmetic.
     49    PS_TYPE_INT8,                       ///< Character.
     50    PS_TYPE_INT16,                      ///< Short integer.
     51    PS_TYPE_INT32,                      ///< Integer.
     52    PS_TYPE_INT64,                      ///< Long integer.
     53    PS_TYPE_UINT8,                      ///< Unsigned character.
     54    PS_TYPE_UINT16,                     ///< Unsigned short integer.
     55    PS_TYPE_UINT32,                     ///< Unsigned integer.
     56    PS_TYPE_UINT64,                     ///< Unsigned long integer.
     57    PS_TYPE_FLOAT,                      ///< Single-precision Floating point.
     58    PS_TYPE_DOUBLE,                     ///< Double-precision floating point.
     59    PS_TYPE_COMPLEX_FLOAT,              ///< Complex numbers consisting of single-precision floating point.
     60    PS_TYPE_COMPLEX_DOUBLE,             ///< Complex numbers consisting of double-precision floating point.
     61    PS_TYPE_OTHER,                      ///< Something else that's not supported for arithmetic.
    6162} psElemType;
    6263
     
    9495typedef struct
    9596{
    96     psType type;            ///< Type of data.
    97     int nalloc;             ///< Total number of elements available.
    98     int n;                  ///< Number of elements in use.
     97    psType type;                        ///< Type of data.
     98    unsigned int nalloc;                ///< Total number of elements available.
     99    unsigned int n;                     ///< Number of elements in use.
    99100
    100101    union {
    101         char *c;            ///< Pointers to char integer data.
    102         short *s;           ///< Pointers to short integer data.
    103         int *i;             ///< Pointers to integer data.
    104         long *l;            ///< Pointers to long integer data.
    105         unsigned char *uc;  ///< Pointers to unsigned char integer data.
    106         unsigned short *us; ///< Pointers to unsigned short integer data.
    107         unsigned int *ui;   ///< Pointers to unsigned integer data.
    108         unsigned long *ul;  ///< Pointers to unsigned long integer data.
    109         float *f;           ///< Pointers to floating point data.
    110         double *d;          ///< Pointers to double precision data.
    111         complex float *cf;  ///< Pointers to complex floating point data.
    112         void **vp;          ///< Void pointer vector.
    113     }vec;                   ///< Union for data types.
     102        int8_t *i8;                     ///< Pointers to char integer data.
     103        int16_t *i16;                   ///< Pointers to short integer data.
     104        int32_t *i32;                   ///< Pointers to integer data.
     105        int64_t *i64;                   ///< Pointers to long integer data.
     106        uint8_t *ui8;                   ///< Pointers to unsigned char integer data.
     107        uint16_t*ui16;                  ///< Pointers to unsigned short integer data.
     108        uint32_t *ui32;                 ///< Pointers to unsigned integer data.
     109        uint64_t *ui64;                 ///< Pointers to unsigned long integer data.
     110        float *f;                       ///< Pointers to floating point data.
     111        double *d;                      ///< Pointers to double precision data.
     112        complex float *cf;              ///< Pointers to complex floating point data.
     113        void **vp;                      ///< Void pointer vector.
     114    }vec;                               ///< Union for data types.
    114115}
    115116psVector;
     
    127128 */
    128129psVector *psVectorAlloc(
    129     psType type,    ///< Type of data to be held by vector.
    130     int nalloc      ///< Total number of elements to make available.
     130    psType type,                        ///< Type of data to be held by vector.
     131    unsigned int nalloc                 ///< Total number of elements to make available.
    131132);
    132133
     
    134135 *
    135136 * Uses psLib memory allocation functions to reallocate a vector collection of data. The vector is reallocated
    136  * according to the psType type member contained within the vector. 
     137 * according to the psType type member contained within the vector.
    137138 *
    138139 * @return psVector*: Pointer to psVector.
     
    140141 */
    141142psVector *psVectorRealloc(
    142     psVector *restrict psVec,   ///< Vector to reallocate.
    143     int nalloc                  ///< Total number of elements to make available.
     143    psVector *restrict psVec,           ///< Vector to reallocate.
     144    unsigned int nalloc                 ///< Total number of elements to make available.
    144145);
    145146
     
    147148 *
    148149 * Uses psLib memory allocation functions to deallocate a vector collection of data. The vector is deallocated
    149  * according to the psType type member contained within the vector. 
     150 * according to the psType type member contained within the vector.
    150151 *
    151152 * @return psVector*: Pointer to psVector.
     
    165166 */
    166167psVector *psVoidPtrVectorAlloc(
    167     int nalloc  ///< Number of elements to use.
     168    unsigned int nalloc                 ///< Number of elements to use.
    168169);
    169170
    170171/** Reallocate a void pointer vector.
    171172 *
    172  * Uses psLib memory allocation functions to reallocate a vector of void pointers as defined by the 
    173  * psVoidPtrVector struct. If the vector size is increased or decreased, this function does not allocate or 
     173 * Uses psLib memory allocation functions to reallocate a vector of void pointers as defined by the
     174 * psVoidPtrVector struct. If the vector size is increased or decreased, this function does not allocate or
    174175 * deallocate the contents of individual vector elements. The user must do this after calling this function.
    175176 *
     
    178179 */
    179180psVector *psVoidPtrVectorRealloc(
    180     psVector *restrict psVec,   ///< Void pointer vector to destroy.
    181     int nalloc                  ///< Number of elements.
     181    psVector *restrict psVec,           ///< Void pointer vector to destroy.
     182    unsigned int nalloc                 ///< Number of elements.
    182183);
    183184
    184185/** Deallocate a void pointer vector.
    185186 *
    186  * Uses psLib memory allocation functions to deallocate a vector of void pointers as defined by the 
    187  * psVoidPtrVector struct. This function does not free the vector elements unless the user provides a callback 
    188  * function. NULL may be passed as an alternative to supplying a callback, but the user must remember to 
    189  * delete the vector elements afterwards. The user must not delete or deallocate the vector elements prior to 
     187 * Uses psLib memory allocation functions to deallocate a vector of void pointers as defined by the
     188 * psVoidPtrVector struct. This function does not free the vector elements unless the user provides a callback
     189 * function. NULL may be passed as an alternative to supplying a callback, but the user must remember to
     190 * delete the vector elements afterwards. The user must not delete or deallocate the vector elements prior to
    190191 * calling this function, as it requires valid elements for memory reference decrementation operations.
    191192 *
Note: See TracChangeset for help on using the changeset viewer.