Changeset 642 for trunk/psLib/src/dataManip/psStats.h
- Timestamp:
- May 11, 2004, 2:40:23 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psStats.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psStats.h
r563 r642 6 6 * \ingroup MathGroup 7 7 */ 8 9 /****************************************************************************** 10 The following typedefs and functions belong in the psArray.h and psArray.c 11 files. However, those files are not available at this time, due to the 12 changing definition of the psLib data/functions. For temporary purposes 13 only, I am including them here so that I can continue coding while our 14 basic data types are still being implemented. 15 *****************************************************************************/ 16 typedef enum { 17 PS_TYPE_CHAR, 18 PS_TYPE_SHORT, 19 PS_TYPE_INT, 20 PS_TYPE_LONG, 21 PS_TYPE_UCHAR, 22 PS_TYPE_USHORT, 23 PS_TYPE_UINT, 24 PS_TYPE_ULONG, 25 PS_TYPE_FLOAT, 26 PS_TYPE_DOUBLE, 27 PS_TYPE_COMPLEX, 28 PS_TYPE_OTHER, 29 } psElemType; 30 31 typedef enum { 32 PS_DIMEN_SCALAR, 33 PS_DIMEN_VECTOR, 34 PS_DIMEN_TRANSV, 35 PS_DIMEN_IMAGE, 36 PS_DIMEN_OTHER 37 } psDimen; 38 39 typedef struct 40 { 41 psElemType type; 42 psDimen dimen; 43 } 44 psType; 45 46 typedef struct 47 { 48 psType type; ///< Type of data. 49 int nalloc; ///< Total number of elements available. 50 int n; ///< Number of elements in use. 51 52 union { 53 int *vecI; 54 float *vecF; 55 double *vecD; 56 // complex float *vecC; 57 void **vecP; 58 }vec; ///< Union with array data. 59 } 60 psVector; 61 62 psVector *psVectorAlloc(int nalloc, 63 psElemType type) 64 { 65 return(NULL); 66 } 67 68 psVector *psVectorRealloc(psVector myVector, 69 int nalloc) 70 { 71 return(NULL); 72 } 73 74 void psVectorFree(psVector *restrict psArr) 75 {} 8 76 9 77 /** statistics which may be calculated */ … … 65 133 /** Do Statistics on an array. Returns a status value. \ingroup MathGroup */ 66 134 psStats * 67 psArrayStats(const psFloatArray *restrict myArray, ///< Array to be analysed 68 const psIntArray *restrict maskArray, ///< Ignore elements where (maskArray & maskVal) != 0 69 ///< May be NULL 70 unsigned int maskVal, ///< Only mask elements with one of these bits set in maskArray 135 psArrayStats(const psVector *restrict myVector, ///< Vector to be analysed 136 // must be FLOAT 137 const psVector *restrict maskVector, ///< Ignore elements where (maskVector & maskVal) != 0 138 // must be INT or NULL 139 unsigned int maskVal, ///< Only mask elements with one of these bits set in maskVector 71 140 psStats *stats ///< stats structure defines stats to be calculated and how 72 141 ); … … 87 156 typedef struct 88 157 { 89 const psFloatArray *restrict lower; ///< Lower bounds for the bins 90 const psFloatArray *restrict upper; ///< Upper bounds for the bins 91 psIntArray *nums; ///< Number in each of the bins 92 float minVal, maxVal; ///< Minimum and maximum values 93 int minNum, maxNum; ///< Number below the minimum and above the maximum 158 const psVector *restrict lower; ///< Lower bounds for the bins (FLOAT) 159 const psVector *restrict upper; ///< Upper bounds for the bins (FLOAT) 160 psVector *nums; ///< Number in each of the bins (INT) 161 float minVal; 162 float maxVal; ///< Minimum and maximum values 163 int minNum; 164 int maxNum; ///< Number below the minimum and above the maximum 94 165 } 95 166 psHistogram; … … 104 175 /** Generic constructor \ingroup MathGroup */ 105 176 psHistogram * 106 psHistogramAllocGeneric(const ps FloatArray*restrict lower, ///< Lower bounds for the bins107 const ps FloatArray*restrict upper, ///< Upper bounds for the bins177 psHistogramAllocGeneric(const psVector *restrict lower, ///< Lower bounds for the bins 178 const psVector *restrict upper, ///< Upper bounds for the bins 108 179 float minVal, ///< Minimum value 109 180 float maxVal ///< Maximum value … … 119 190 psHistogram * 120 191 psGetArrayHistogram(psHistogram *restrict myHist, ///< Histogram data 121 const ps FloatArray *restrict myArray ///< Arrayto analyse192 const psVector *restrict myVector ///< Vector to analyse 122 193 ); 123 194
Note:
See TracChangeset
for help on using the changeset viewer.
