Changeset 1407 for trunk/psLib/src/collections/psVector.h
- Timestamp:
- Aug 6, 2004, 2:06:06 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psVector.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psVector.h
r1406 r1407 1 1 2 /** @file psVector.h 2 3 * … … 11 12 * @author Ross Harman, MHPCC 12 13 * 13 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 6 22:34:05$14 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-07 00:06:06 $ 15 16 * 16 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 18 19 19 20 #ifndef PS_VECTOR_H 20 # define PS_VECTOR_H21 # define PS_VECTOR_H 21 22 22 # include "psType.h"23 # include "psType.h" 23 24 24 25 /// @addtogroup Vector … … 32 33 typedef struct 33 34 { 34 psType type; ///< Type of data.35 unsigned int nalloc; ///< Total number of elements available.36 unsigned int n; ///< Number of elements in use.35 psType type; // /< Type of data. 36 unsigned int nalloc; // /< Total number of elements available. 37 unsigned int n; // /< Number of elements in use. 37 38 38 39 union { 39 psU8 *U8; ///< Unsigned 8-bit integer data.40 psU16 *U16; ///< Unsigned 16-bit integer data.41 psU32 *U32; ///< Unsigned 32-bit integer data.42 psU64 *U64; ///< Unsigned 64-bit integer data.43 psS8 *S8; ///< Signed 8-bit integer data.44 psS16 *S16; ///< Signed 16-bit integer data.45 psS32 *S32; ///< Signed 32-bit integer data.46 psS64 *S64; ///< Signed 64-bit integer data.47 psF32 *F32; ///< Single-precision float data.48 psF64 *F64; ///< Double-precision float data.49 psC32 *C32; ///< Single-precision complex data.50 psC64 *C64; ///< Double-precision complex data.51 psPTR V; ///< Pointer to data.52 } data; ///< Union for data types.40 psU8 *U8; // /< Unsigned 8-bit integer data. 41 psU16 *U16; // /< Unsigned 16-bit integer data. 42 psU32 *U32; // /< Unsigned 32-bit integer data. 43 psU64 *U64; // /< Unsigned 64-bit integer data. 44 psS8 *S8; // /< Signed 8-bit integer data. 45 psS16 *S16; // /< Signed 16-bit integer data. 46 psS32 *S32; // /< Signed 32-bit integer data. 47 psS64 *S64; // /< Signed 64-bit integer data. 48 psF32 *F32; // /< Single-precision float data. 49 psF64 *F64; // /< Double-precision float data. 50 psC32 *C32; // /< Single-precision complex data. 51 psC64 *C64; // /< Double-precision complex data. 52 psPTR V; // /< Pointer to data. 53 } data; // /< Union for data types. 53 54 } 54 55 psVector; 55 56 56 57 /*****************************************************************************/ 58 57 59 /* FUNCTION PROTOTYPES */ 60 58 61 /*****************************************************************************/ 59 62 … … 65 68 * 66 69 */ 67 psVector *psVectorAlloc( 68 unsigned int nalloc, ///< Total number of elements to make available. 69 psElemType dataType ///< Type of data to be held by vector. 70 ); 70 psVector *psVectorAlloc(unsigned int nalloc, // /< Total number of elements to make available. 71 psElemType dataType // /< Type of data to be held by vector. 72 ); 71 73 72 74 /** Reallocate a vector. … … 78 80 * 79 81 */ 80 psVector *psVectorRealloc( 81 unsigned int nalloc, ///< Total number of elements to make available. 82 psVector *restrict psVec ///< Vector to reallocate. 83 ); 82 psVector *psVectorRealloc(unsigned int nalloc, // /< Total number of elements to make available. 83 psVector * restrict psVec // /< Vector to reallocate. 84 ); 84 85 85 86 /** Recycle a vector. … … 91 92 * 92 93 */ 93 psVector *psVectorRecycle( 94 psVector *restrict psVec, 95 ///< Vector to recycle. If NULL, a new vector is created. No effort taken to preserve the values. 96 97 unsigned int nalloc, ///< Total number of elements to make available. 98 psElemType type ///< the datatype of the returned vector 99 ); 94 psVector *psVectorRecycle(psVector * restrict psVec, 95 // /< Vector to recycle. If NULL, a new vector is created. No effort taken to 96 // preserve the values. 97 unsigned int nalloc, // /< Total number of elements to make available. 98 psElemType type // /< the datatype of the returned vector 99 ); 100 100 101 101 /** Sort an array of floats. … … 107 107 */ 108 108 109 psVector *psVectorSort( 110 psVector *restrict outVector, ///< the output vector to recycle, or NULL if newvector desired.111 const psVector *restrict inVector ///< the vector to sort.112 );109 psVector *psVectorSort(psVector * restrict outVector, // /< the output vector to recycle, or NULL if new 110 // vector desired. 111 const psVector * restrict inVector // /< the vector to sort. 112 ); 113 113 114 114 /** Creates an array of indices based on sort odred of float array. … … 120 120 */ 121 121 122 psVector *psVectorSortIndex( 123 psVector *restrict outVector, 124 const psVector *restrict inVector 125 ); 126 122 psVector *psVectorSortIndex(psVector * restrict outVector, const psVector * restrict inVector); 127 123 128 124 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
