Changeset 661
- Timestamp:
- May 13, 2004, 9:28:35 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 edited
-
collections/psVector.h (modified) (9 diffs)
-
mathtypes/psVector.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psVector.h
r645 r661 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-05-1 2 18:07:22$21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-05-13 19:28:35 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 */ 48 48 typedef 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. 61 62 } psElemType; 62 63 … … 94 95 typedef struct 95 96 { 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. 99 100 100 101 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 u nsigned char *uc;///< Pointers to unsigned char integer data.106 u nsigned short *us;///< Pointers to unsigned short integer data.107 u nsigned int *ui;///< Pointers to unsigned integer data.108 u nsigned 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. 114 115 } 115 116 psVector; … … 127 128 */ 128 129 psVector *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. 131 132 ); 132 133 … … 134 135 * 135 136 * 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. 137 138 * 138 139 * @return psVector*: Pointer to psVector. … … 140 141 */ 141 142 psVector *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. 144 145 ); 145 146 … … 147 148 * 148 149 * 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. 150 151 * 151 152 * @return psVector*: Pointer to psVector. … … 165 166 */ 166 167 psVector *psVoidPtrVectorAlloc( 167 int nalloc///< Number of elements to use.168 unsigned int nalloc ///< Number of elements to use. 168 169 ); 169 170 170 171 /** Reallocate a void pointer vector. 171 172 * 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 174 175 * deallocate the contents of individual vector elements. The user must do this after calling this function. 175 176 * … … 178 179 */ 179 180 psVector *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. 182 183 ); 183 184 184 185 /** Deallocate a void pointer vector. 185 186 * 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 190 191 * calling this function, as it requires valid elements for memory reference decrementation operations. 191 192 * -
trunk/psLib/src/mathtypes/psVector.h
r645 r661 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-05-1 2 18:07:22$21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-05-13 19:28:35 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 */ 48 48 typedef 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. 61 62 } psElemType; 62 63 … … 94 95 typedef struct 95 96 { 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. 99 100 100 101 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 u nsigned char *uc;///< Pointers to unsigned char integer data.106 u nsigned short *us;///< Pointers to unsigned short integer data.107 u nsigned int *ui;///< Pointers to unsigned integer data.108 u nsigned 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. 114 115 } 115 116 psVector; … … 127 128 */ 128 129 psVector *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. 131 132 ); 132 133 … … 134 135 * 135 136 * 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. 137 138 * 138 139 * @return psVector*: Pointer to psVector. … … 140 141 */ 141 142 psVector *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. 144 145 ); 145 146 … … 147 148 * 148 149 * 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. 150 151 * 151 152 * @return psVector*: Pointer to psVector. … … 165 166 */ 166 167 psVector *psVoidPtrVectorAlloc( 167 int nalloc///< Number of elements to use.168 unsigned int nalloc ///< Number of elements to use. 168 169 ); 169 170 170 171 /** Reallocate a void pointer vector. 171 172 * 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 174 175 * deallocate the contents of individual vector elements. The user must do this after calling this function. 175 176 * … … 178 179 */ 179 180 psVector *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. 182 183 ); 183 184 184 185 /** Deallocate a void pointer vector. 185 186 * 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 190 191 * calling this function, as it requires valid elements for memory reference decrementation operations. 191 192 *
Note:
See TracChangeset
for help on using the changeset viewer.
