Changeset 4597 for trunk/psLib/src/mathtypes
- Timestamp:
- Jul 22, 2005, 12:19:31 PM (21 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 2 edited
-
psVector.c (modified) (11 diffs)
-
psVector.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psVector.c
r4540 r4597 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 6$ $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 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 typedef struct 31 31 { 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; 33 46 psU32 index; 34 47 } … … 48 61 // FUNCTION IMPLEMENTATION - PUBLIC 49 62 50 psVector* psVectorAlloc( long nalloc, psElemType type) 63 psVector* psVectorAlloc(long nalloc, 64 psElemType type) 51 65 { 52 66 psVector* psVec = NULL; … … 76 90 } 77 91 78 psVector* psVectorRealloc(psVector* vector, long nalloc) 92 psVector* psVectorRealloc(psVector* vector, 93 long nalloc) 79 94 { 80 95 psS32 elementSize = 0; … … 99 114 } 100 115 101 psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type) 116 psVector* psVectorRecycle(psVector* vector, 117 long nalloc, 118 psElemType type) 102 119 { 103 120 psS32 byteSize; … … 129 146 } 130 147 131 psVector *psVectorExtend(psVector *vector, long delta, long nExtend) 148 psVector *psVectorExtend(psVector *vector, 149 long delta, 150 long nExtend) 132 151 { 133 152 // can't handle a NULL vector (don't know the data type to allocate) … … 166 185 } 167 186 168 psVector* psVectorCopy(psVector* output, const psVector* input, psElemType type) 187 psVector* psVectorCopy(psVector* output, 188 const psVector* input, 189 psElemType type) 169 190 { 170 191 if (input == NULL) { … … 267 288 } 268 289 269 psVector* psVectorSort(psVector* outVector, const psVector* inVector) 290 psVector* psVectorSort(psVector* outVector, 291 const psVector* inVector) 270 292 { 271 293 psS32 N = 0; … … 353 375 } 354 376 355 psVector* psVectorSortIndex(psVector* outVector, const psVector* inVector) 377 psVector* psVectorSortIndex(psVector* outVector, 378 const psVector* inVector) 356 379 { 357 380 psS32 N = 0; … … 437 460 } 438 461 439 char* psVectorToString(psVector* vector, int maxLength) 462 char* psVectorToString(psVector* vector, 463 int maxLength) 440 464 { 441 465 … … 570 594 } 571 595 572 bool p_psVectorPrint (FILE *f, psVector *a, char *name) 596 bool p_psVectorPrint (FILE *f, 597 psVector *a, 598 char *name) 573 599 { 574 600 -
trunk/psLib/src/mathtypes/psVector.h
r4540 r4597 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 8$ $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 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 29 29 ///< Union of psVector data types. 30 /* 30 31 typedef union { 31 32 psU8* U8; ///< Unsigned 8-bit integer data. … … 43 44 } 44 45 p_psVectorData; 45 46 */ 46 47 /** An vector to support primitive types. 47 48 * … … 54 55 long n; ///< Number of elements in use. 55 56 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; 57 71 void *lock; ///< Optional lock for thread safety. 58 72 }
Note:
See TracChangeset
for help on using the changeset viewer.
