Changeset 10550 for trunk/psLib/src/math/psStats.h
- Timestamp:
- Dec 8, 2006, 1:38:54 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.h
r8468 r10550 7 7 * on those data structures. 8 8 * 9 * XXX: The following stats members are never used, or set in this code.10 * stats->robustN5011 * stats->clippedNvalues12 * stats->binsize13 *14 9 * @author GLG, MHPCC 15 10 * 16 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2006- 08-22 15:02:08$11 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-12-08 11:38:54 $ 18 13 * 19 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 20 15 */ 16 21 17 #ifndef PS_STATS_H 22 18 #define PS_STATS_H 23 19 24 #include "psVector.h"20 // #include "psVector.h" 25 21 26 22 /// @addtogroup Stats … … 35 31 * @see psStats, psVectorStats, psImageStats 36 32 */ 37 // XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete?38 33 typedef enum { 34 PS_STAT_NONE = 0x000000, ///< Empty set 39 35 PS_STAT_SAMPLE_MEAN = 0x000001, ///< Sample Mean 40 36 PS_STAT_SAMPLE_MEDIAN = 0x000002, ///< Sample Median … … 51 47 PS_STAT_MIN = 0x001000, ///< Minumum 52 48 PS_STAT_USE_RANGE = 0x002000, ///< Range 53 PS_STAT_USE_BINSIZE = 0x004000 ///< Binsize 49 PS_STAT_USE_BINSIZE = 0x004000, ///< Binsize 50 PS_STAT_FITTED_MEAN_V2 = 0x008000, ///< Fitted Mean 51 PS_STAT_FITTED_STDEV_V2 = 0x010000, ///< Fitted Standard Deviation 54 52 } psStatsOptions; 55 53 … … 81 79 double binsize; ///< binsize for robust fit (input/ouput) 82 80 long nSubsample; ///< maxinum number of measurements (input) 83 psStatsOptions options; ///< bitmask of calculated values 81 psStatsOptions options; ///< bitmask of values requested 82 psStatsOptions results; ///< bitmask of values calculated 84 83 } 85 84 psStats; … … 89 88 * @return psStats* the statistical results as specified by stats->options 90 89 */ 91 psStats*psVectorStats(90 bool psVectorStats( 92 91 psStats* stats, ///< stats structure defines stats to be calculated and how 93 92 const psVector* in, ///< Vector to be analysed. … … 117 116 ); 118 117 119 120 /******************************************************************************121 Histogram functions and data structures.122 *****************************************************************************/123 124 /** The basic histogram structure which contains bounds and bins.125 *126 * In this structure, the vector bounds specifies the boundaries of the127 * histogram bins, and must of type psF32, while nums specifies the number128 * of entries in the bin, and must of type psU32. The value of bounds.n must129 * therefore be 1 greater than than nums.n. The two values minNum and maxNum130 * are the number of data values which fell below the lower limit bound or131 * above the upper limit bound, respectively.132 */133 typedef struct134 {135 const psVector* bounds; ///< Bounds for the bins (type F32)136 psVector* nums; ///< Number in each of the bins (INT)137 int minNum; ///< Number below the minimum138 int maxNum; ///< Number above the maximum139 bool uniform; ///< Is it a uniform distribution?140 }141 psHistogram;142 143 /** Allocator for psHistogram where the bounds of the bins are implicitly144 * specified through simply specifying an upper and lower limit along with145 * the size of the bins.146 *147 * @return psHistogram* Newly allocated psHistogram148 */149 psHistogram* psHistogramAlloc(150 float lower, ///< Lower limit for the bins151 float upper, ///< Upper limit for the bins152 int n ///< Number of bins153 );154 155 156 /** Checks the type of a particular pointer.157 *158 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.159 *160 * @return bool: True if the pointer matches a psHistogram structure, false otherwise.161 */162 bool psMemCheckHistogram(163 psPtr ptr ///< the pointer whose type to check164 );165 166 167 /** Allocator for psHistogram where the bounds of the bins are explicitly168 * specified.169 *170 * @return psHistogram* Newly allocated psHistogram171 */172 psHistogram* psHistogramAllocGeneric(173 const psVector* bounds ///< Bounds for the bins174 );175 176 /** Calculate a histogram177 *178 * The following function populates the histogram bins from the specified179 * vector (in). It alters and returns the histogram out structure. The input180 * vector may be of types psU8, psU16, psF32, psF64.181 *182 * @return psHistogram* histogram result183 */184 psHistogram* psVectorHistogram(185 psHistogram* out, ///< Histogram data186 const psVector* values, ///< Vector to analyse187 const psVector* errors, ///< Errors188 const psVector* mask, ///< Mask dat for input vector189 psMaskType maskVal ///< Mask value190 );191 192 193 118 // Get the statistics option from a string 194 119 psStatsOptions psStatsOptionFromString(const char *string); … … 207 132 208 133 #endif // #ifndef PS_STATS_H 134 135 /* 136 * private stats functions used in psStats.c: 137 * 138 * vectorSampleMean 139 (none) 140 * vectorMinMax 141 (none) 142 * vectorSampleMedian (also yields SAMPLE_QUARTILE) 143 (none) 144 * vectorSampleStdev 145 (vectorSampleMean) 146 * vectorClippedStats 147 (vectorSampleMedian) 148 (vectorSampleMean (*also subset)) 149 (vectorSampleStdev (*also subset)) 150 * vectorRobustStats 151 (vectorMinMax (*only subset)) 152 * vectorFittedStats 153 (vectorRobustStats) 154 155 * private stats functions called by other private stats functions are automatically called by 156 * those functions. since they set the stats->results flags, they are not called multiple 157 * times. 158 159 * the private stats functions do not test for their corresponding stats flags: it is not 160 * necessary to request them if they are called within this function. 161 162 */
Note:
See TracChangeset
for help on using the changeset viewer.
