Changeset 1470
- Timestamp:
- Aug 11, 2004, 9:16:04 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
dataManip/psMinimize.h (modified) (2 diffs)
-
dataManip/psStats.h (modified) (5 diffs)
-
math/psMinimize.h (modified) (2 diffs)
-
math/psStats.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMinimize.h
r1469 r1470 27 27 * 28 28 * @return float the derivative in respect to params[derivParam] 29 */ 29 30 typedef float (*psMinimizeFunctionDeriv) ( 30 31 const psVector* restrict params, ///< collection of parameters … … 32 33 int derivParam ///< index of parameter to calculate derivative of 33 34 ); 34 35 35 36 /** Minimizes a non-linear function. 36 37 * -
trunk/psLib/src/dataManip/psStats.h
r1441 r1470 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:40:55$12 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-11 19:16:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 Statistical functions and data structures. 27 27 *****************************************************************************/ 28 29 /** enumeration of statistical calculation options 30 * 31 * @see psStats, psVectorStats, psImageStats 32 */ 28 33 typedef enum { 29 34 PS_STAT_SAMPLE_MEAN = 0x000001, … … 46 51 47 52 /** This is the generic statistics structure. It contails the data members 48 for the various statistic values. It contains the options member to49 specifiy which statistics mustbe calculated. */53 for the various statistic values. It also contains the options member to 54 specifiy which statistics should be calculated. */ 50 55 typedef struct 51 56 { … … 76 81 psStats; 77 82 78 /** Do Statistics on an array. Returns a status value. \ingroup MathGroup */ 79 psStats* psVectorStats(psStats* stats, ///< stats structure defines stats to be calculated and how 80 psVector* in, ///< Vector to be analysed: must be F32 81 psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT 82 // or NULL 83 unsigned int maskVal ///< Only mask elements with one of these bits set in 84 // maskVector 85 ); 83 /** Performs statistical calculations on a vector. 84 * 85 * @return psStats* the statistical results as specified by stats->options 86 */ 87 psStats* psVectorStats( 88 psStats* stats, 89 ///< stats structure defines stats to be calculated and how 86 90 87 /** A constructor for the stats structure.*/ 88 psStats* psStatsAlloc(psStatsOptions options); ///< Statistics to measure 91 psVector* in, 92 ///< Vector to be analysed: must be F32 93 94 psVector* mask, 95 ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 97 unsigned int maskVal 98 ///< Only mask elements with one of these bits set in maskVector 99 ); 100 101 /** Allocator of the psStats structure. 102 * 103 * @return psStats* A new psStats struct with the options member set to the 104 * value given. 105 */ 106 psStats* psStatsAlloc( 107 psStatsOptions options ///< Statistics to calculate 108 ); 89 109 90 110 /****************************************************************************** … … 92 112 *****************************************************************************/ 93 113 94 /** The basic histogram structure which contains bounds and bins. */ 114 /** The basic histogram structure which contains bounds and bins. 115 * 116 * In this structure, the vector bounds specifies the boundaries of the 117 * histogram bins, and must of type psF32, while nums specifies the number 118 * of entries in the bin, and must of type psU32. The value of bounds.n must 119 * therefore be 1 greater than than nums.n. The two values minNum and maxNum 120 * are the number of data values which fell below the lower limit bound or 121 * above the upper limit bound, respectively. 122 */ 95 123 typedef struct 96 124 { 97 psVector* bounds; ///< Bounds for the bins (type F32)98 psVector* nums; ///< Number in each of the bins (INT)99 int minNum; ///< Number below the minimum100 int maxNum; ///< Number above the maximum101 bool uniform; ///< Is it a uniform distribution?125 psVector* bounds; ///< Bounds for the bins (type F32) 126 psVector* nums; ///< Number in each of the bins (INT) 127 int minNum; ///< Number below the minimum 128 int maxNum; ///< Number above the maximum 129 bool uniform; ///< Is it a uniform distribution? 102 130 } 103 131 psHistogram; 104 132 105 /** Constructor \ingroup MathGroup */ 106 psHistogram* psHistogramAlloc(float lower, ///< Lower limit for the bins 107 float upper, ///< Upper limit for the bins 108 int n); ///< Number of bins 133 /** Allocator for psHistogram where the bounds of the bins are implicitly 134 * specified through simply specifying an upper and lower limit along with 135 * the size of the bins. 136 * 137 * @return psHistogram* Newly allocated psHistogram 138 */ 139 psHistogram* psHistogramAlloc( 140 float lower, ///< Lower limit for the bins 141 float upper, ///< Upper limit for the bins 142 int n ///< Number of bins 143 ); 109 144 110 /** Generic constructor \ingroup MathGroup */ 111 psHistogram* psHistogramAllocGeneric(const psVector* restrict bounds); ///< Bounds for the bins 145 /** Allocator for psHistogram where the bounds of the bins are explicitly 146 * specified. 147 * 148 * @return psHistogram* Newly allocated psHistogram 149 */ 150 psHistogram* psHistogramAllocGeneric( 151 const psVector* restrict bounds ///< Bounds for the bins 152 ); 112 153 113 /** Calculate a histogram \ingroup MathGroup **/ 114 psHistogram* psVectorHistogram(psHistogram* out, ///< Histogram data 115 const psVector* restrict in, ///< Vector to analyse 116 const psVector* restrict mask, ///< Mask dat for input vector 117 unsigned int maskVal); ///< Mask value 154 /** Calculate a histogram 155 * 156 * The following function populates the histogram bins from the specified 157 * vector (in). It alters and returns the histogram out structure. The input 158 * vector may be of types psU8, psU16, psF32, psF64. 159 * 160 * @return psHistogram* histogram result 161 */ 162 psHistogram* psVectorHistogram( 163 psHistogram* out, ///< Histogram data 164 const psVector* restrict in, ///< Vector to analyse 165 const psVector* restrict mask, ///< Mask dat for input vector 166 unsigned int maskVal ///< Mask value 167 ); 118 168 119 bool p_psGetStatValue(const psStats* stats, double *value); 169 /** Extracts the statistic value specified by stats->options. 170 * 171 * @return bool If more than one statistic result is set in stats->options, 172 * false is returned and the value parameter is not set, 173 * otherwise true is returned. 174 */ 175 bool p_psGetStatValue( 176 const psStats* stats, 177 ///< the statistic struct to operate on 178 179 double *value 180 ///< if return is true, this is set to the specified statistic value by stats->options 181 ); 120 182 121 183 /// @} -
trunk/psLib/src/math/psMinimize.h
r1469 r1470 27 27 * 28 28 * @return float the derivative in respect to params[derivParam] 29 */ 29 30 typedef float (*psMinimizeFunctionDeriv) ( 30 31 const psVector* restrict params, ///< collection of parameters … … 32 33 int derivParam ///< index of parameter to calculate derivative of 33 34 ); 34 35 35 36 /** Minimizes a non-linear function. 36 37 * -
trunk/psLib/src/math/psStats.h
r1441 r1470 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:40:55$12 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-11 19:16:04 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 Statistical functions and data structures. 27 27 *****************************************************************************/ 28 29 /** enumeration of statistical calculation options 30 * 31 * @see psStats, psVectorStats, psImageStats 32 */ 28 33 typedef enum { 29 34 PS_STAT_SAMPLE_MEAN = 0x000001, … … 46 51 47 52 /** This is the generic statistics structure. It contails the data members 48 for the various statistic values. It contains the options member to49 specifiy which statistics mustbe calculated. */53 for the various statistic values. It also contains the options member to 54 specifiy which statistics should be calculated. */ 50 55 typedef struct 51 56 { … … 76 81 psStats; 77 82 78 /** Do Statistics on an array. Returns a status value. \ingroup MathGroup */ 79 psStats* psVectorStats(psStats* stats, ///< stats structure defines stats to be calculated and how 80 psVector* in, ///< Vector to be analysed: must be F32 81 psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT 82 // or NULL 83 unsigned int maskVal ///< Only mask elements with one of these bits set in 84 // maskVector 85 ); 83 /** Performs statistical calculations on a vector. 84 * 85 * @return psStats* the statistical results as specified by stats->options 86 */ 87 psStats* psVectorStats( 88 psStats* stats, 89 ///< stats structure defines stats to be calculated and how 86 90 87 /** A constructor for the stats structure.*/ 88 psStats* psStatsAlloc(psStatsOptions options); ///< Statistics to measure 91 psVector* in, 92 ///< Vector to be analysed: must be F32 93 94 psVector* mask, 95 ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 97 unsigned int maskVal 98 ///< Only mask elements with one of these bits set in maskVector 99 ); 100 101 /** Allocator of the psStats structure. 102 * 103 * @return psStats* A new psStats struct with the options member set to the 104 * value given. 105 */ 106 psStats* psStatsAlloc( 107 psStatsOptions options ///< Statistics to calculate 108 ); 89 109 90 110 /****************************************************************************** … … 92 112 *****************************************************************************/ 93 113 94 /** The basic histogram structure which contains bounds and bins. */ 114 /** The basic histogram structure which contains bounds and bins. 115 * 116 * In this structure, the vector bounds specifies the boundaries of the 117 * histogram bins, and must of type psF32, while nums specifies the number 118 * of entries in the bin, and must of type psU32. The value of bounds.n must 119 * therefore be 1 greater than than nums.n. The two values minNum and maxNum 120 * are the number of data values which fell below the lower limit bound or 121 * above the upper limit bound, respectively. 122 */ 95 123 typedef struct 96 124 { 97 psVector* bounds; ///< Bounds for the bins (type F32)98 psVector* nums; ///< Number in each of the bins (INT)99 int minNum; ///< Number below the minimum100 int maxNum; ///< Number above the maximum101 bool uniform; ///< Is it a uniform distribution?125 psVector* bounds; ///< Bounds for the bins (type F32) 126 psVector* nums; ///< Number in each of the bins (INT) 127 int minNum; ///< Number below the minimum 128 int maxNum; ///< Number above the maximum 129 bool uniform; ///< Is it a uniform distribution? 102 130 } 103 131 psHistogram; 104 132 105 /** Constructor \ingroup MathGroup */ 106 psHistogram* psHistogramAlloc(float lower, ///< Lower limit for the bins 107 float upper, ///< Upper limit for the bins 108 int n); ///< Number of bins 133 /** Allocator for psHistogram where the bounds of the bins are implicitly 134 * specified through simply specifying an upper and lower limit along with 135 * the size of the bins. 136 * 137 * @return psHistogram* Newly allocated psHistogram 138 */ 139 psHistogram* psHistogramAlloc( 140 float lower, ///< Lower limit for the bins 141 float upper, ///< Upper limit for the bins 142 int n ///< Number of bins 143 ); 109 144 110 /** Generic constructor \ingroup MathGroup */ 111 psHistogram* psHistogramAllocGeneric(const psVector* restrict bounds); ///< Bounds for the bins 145 /** Allocator for psHistogram where the bounds of the bins are explicitly 146 * specified. 147 * 148 * @return psHistogram* Newly allocated psHistogram 149 */ 150 psHistogram* psHistogramAllocGeneric( 151 const psVector* restrict bounds ///< Bounds for the bins 152 ); 112 153 113 /** Calculate a histogram \ingroup MathGroup **/ 114 psHistogram* psVectorHistogram(psHistogram* out, ///< Histogram data 115 const psVector* restrict in, ///< Vector to analyse 116 const psVector* restrict mask, ///< Mask dat for input vector 117 unsigned int maskVal); ///< Mask value 154 /** Calculate a histogram 155 * 156 * The following function populates the histogram bins from the specified 157 * vector (in). It alters and returns the histogram out structure. The input 158 * vector may be of types psU8, psU16, psF32, psF64. 159 * 160 * @return psHistogram* histogram result 161 */ 162 psHistogram* psVectorHistogram( 163 psHistogram* out, ///< Histogram data 164 const psVector* restrict in, ///< Vector to analyse 165 const psVector* restrict mask, ///< Mask dat for input vector 166 unsigned int maskVal ///< Mask value 167 ); 118 168 119 bool p_psGetStatValue(const psStats* stats, double *value); 169 /** Extracts the statistic value specified by stats->options. 170 * 171 * @return bool If more than one statistic result is set in stats->options, 172 * false is returned and the value parameter is not set, 173 * otherwise true is returned. 174 */ 175 bool p_psGetStatValue( 176 const psStats* stats, 177 ///< the statistic struct to operate on 178 179 double *value 180 ///< if return is true, this is set to the specified statistic value by stats->options 181 ); 120 182 121 183 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
