Changeset 4293 for trunk/psLib/src/math
- Timestamp:
- Jun 16, 2005, 2:11:08 PM (21 years ago)
- Location:
- trunk/psLib/src/math
- Files:
-
- 2 edited
-
psRandom.h (modified) (2 diffs)
-
psStats.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psRandom.h
r4162 r4293 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-06- 08 23:40:45 $12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-17 00:11:05 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 33 33 */ 34 34 35 /** Enumeration containing a flag for psRandom types. */ 35 36 typedef enum { 36 PS_RANDOM_TAUS ///< A maximally equidistributed combined Tausworthe generator.37 PS_RANDOM_TAUS ///< A maximally equidistributed combined Tausworthe generator. 37 38 } psRandomType; 38 39 40 /** Data structure for psRandom. 41 * Contains information on the psRandom type and GNU Scientific Library random number generator. 42 */ 39 43 typedef struct 40 44 { 41 psRandomType type; ///< The type of RNG42 gsl_rng *gsl; ///< The RNG itself45 psRandomType type; ///< The type of RNG 46 gsl_rng *gsl; ///< The RNG itself 43 47 } 44 48 psRandom; 45 49 46 psRandom *psRandomAlloc(psRandomType type, 47 psU64 seed); 50 /** Allocates a psRandom struct. 51 * 52 * @return psRandom*: A new psRandom structure. 53 */ 54 psRandom *psRandomAlloc( 55 psRandomType type, ///< The type of RNG 56 psU64 seed ///< Known value with which to seed the RNG 57 ); 48 58 49 void psRandomReset(psRandom *rand, 50 psU64 seed); 59 /** Resets an existing psRandom struct. 60 * 61 * @return void 62 */ 63 void psRandomReset( 64 psRandom *rand, ///< Existing psRandom struct to reset 65 psU64 seed ///< Known value with which to seed the RNG 66 ); 51 67 52 psF64 psRandomUniform(const psRandom *r); 53 psF64 psRandomGaussian(const psRandom *r); 54 psF64 psRandomPoisson(const psRandom *r, psF64 mean); 68 /** Random number generator based on a uniform distribution on [0,1). 69 * Uses gsl_rng_uniform. 70 * 71 * @return psF64: Random number. 72 */ 73 psF64 psRandomUniform( 74 const psRandom *r ///< psRandom struct for RNG 75 ); 76 77 /** Random number generator based on a Gaussian deviate, N(0,1). 78 * Uses gsl_ran_gaussian. 79 * 80 * @return psF64: Random number. 81 */ 82 psF64 psRandomGaussian( 83 const psRandom *r ///< psRandom struct for RNG 84 ); 85 86 /** Random number generator based on a Poisson distribution with the given mean. 87 * Uses gsl_ran_poisson. 88 * 89 * @return psF64: Random number. 90 */ 91 psF64 psRandomPoisson( 92 const psRandom *r, ///< psRandom struct for RNG 93 psF64 mean ///< Mean value 94 ); 55 95 56 96 /* \} */// End of MathGroup Functions -
trunk/psLib/src/math/psStats.h
r4162 r4293 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-06- 08 23:40:45 $16 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-06-17 00:11:05 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 // XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete? 38 38 typedef enum { 39 PS_STAT_SAMPLE_MEAN = 0x000001, 40 PS_STAT_SAMPLE_MEDIAN = 0x000002, 41 PS_STAT_SAMPLE_STDEV = 0x000004, 42 PS_STAT_SAMPLE_QUARTILE = 0x000008, 43 PS_STAT_ROBUST_MEAN = 0x000010, 44 PS_STAT_ROBUST_MEDIAN = 0x000020, 45 PS_STAT_ROBUST_MODE = 0x000040, 46 PS_STAT_ROBUST_STDEV = 0x000080, 47 PS_STAT_ROBUST_QUARTILE = 0x000100, 48 PS_STAT_CLIPPED_MEAN = 0x000200, 49 PS_STAT_CLIPPED_STDEV = 0x000400, 50 PS_STAT_MAX = 0x000800, 51 PS_STAT_MIN = 0x001000, 52 PS_STAT_USE_RANGE = 0x002000, 53 PS_STAT_USE_BINSIZE = 0x004000, 54 PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 39 PS_STAT_SAMPLE_MEAN = 0x000001, ///< Sample Mean 40 PS_STAT_SAMPLE_MEDIAN = 0x000002, ///< Sample Median 41 PS_STAT_SAMPLE_STDEV = 0x000004, ///< Sample Standard Deviation 42 PS_STAT_SAMPLE_QUARTILE = 0x000008, ///< Sample Quartile 43 PS_STAT_ROBUST_MEAN = 0x000010, ///< Robust Mean 44 PS_STAT_ROBUST_MEDIAN = 0x000020, ///< Robust Median 45 PS_STAT_ROBUST_MODE = 0x000040, ///< Robust Mode 46 PS_STAT_ROBUST_STDEV = 0x000080, ///< Robust Standarad Deviation 47 PS_STAT_ROBUST_QUARTILE = 0x000100, ///< Robust Quartile 48 PS_STAT_CLIPPED_MEAN = 0x000200, ///< Clipped Mean 49 PS_STAT_CLIPPED_STDEV = 0x000400, ///< Clipped Standard Deviation 50 PS_STAT_MAX = 0x000800, ///< Maximum 51 PS_STAT_MIN = 0x001000, ///< Minumum 52 PS_STAT_USE_RANGE = 0x002000, ///< Range 53 PS_STAT_USE_BINSIZE = 0x004000, ///< Binsize 54 PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 ///< Robust for sample 55 55 } psStatsOptions; 56 56 … … 180 180 // XXX: Create a single, generic, version of the vector normalize function. 181 181 // XXX: Ask IfA for a public psLib function. 182 void p_psNormalizeVectorRangeU8(psVector* myData, psU8 low, psU8 high); 183 void p_psNormalizeVectorRangeU16(psVector* myData, psU16 low, psU16 high); 184 void p_psNormalizeVectorRangeU32(psVector* myData, psU32 low, psU32 high); 185 void p_psNormalizeVectorRangeU64(psVector* myData, psU64 low, psU64 high); 186 void p_psNormalizeVectorRangeS8(psVector* myData, psS8 low, psS8 high); 187 void p_psNormalizeVectorRangeS16(psVector* myData, psS16 low, psS16 high); 188 void p_psNormalizeVectorRangeS32(psVector* myData, psS32 low, psS32 high); 189 void p_psNormalizeVectorRangeS64(psVector* myData, psS64 low, psS64 high); 190 void p_psNormalizeVectorRangeF32(psVector* myData, psF32 low, psF32 high); 191 void p_psNormalizeVectorRangeF64(psVector* myData, psF64 low, psF64 high); 182 183 /** Normalize the range of a vector containing U8 values */ 184 void p_psNormalizeVectorRangeU8( 185 psVector* myData, ///< Vector containing the U8 values 186 psU8 low, ///< Minimum value 187 psU8 high ///< Maximum value 188 ); 189 190 /** Normalize the range of a vector containing U16 values */ 191 void p_psNormalizeVectorRangeU16( 192 psVector* myData, ///< Vector containing the U16 values 193 psU16 low, ///< Minimum value 194 psU16 high ///< Maximum value 195 ); 196 197 /** Normalize the range of a vector containing U32 values */ 198 void p_psNormalizeVectorRangeU32( 199 psVector* myData, ///< Vector containing the U32 values 200 psU32 low, ///< Minimum value 201 psU32 high ///< Maximum value 202 ); 203 204 /** Normalize the range of a vector containing U64 values */ 205 void p_psNormalizeVectorRangeU64( 206 psVector* myData, ///< Vector containing the U64 values 207 psU64 low, ///< Minimum value 208 psU64 high ///< Maximum value 209 ); 210 211 /** Normalize the range of a vector containing S8 values */ 212 void p_psNormalizeVectorRangeS8( 213 psVector* myData, ///< Vector containing the S8 values 214 psS8 low, ///< Minimum value 215 psS8 high ///< Maximum value 216 ); 217 218 /** Normalize the range of a vector containing S16 values */ 219 void p_psNormalizeVectorRangeS16( 220 psVector* myData, ///< Vector containing the S16 values 221 psS16 low, ///< Minimum value 222 psS16 high ///< Maximum value 223 ); 224 225 /** Normalize the range of a vector containing S32 values */ 226 void p_psNormalizeVectorRangeS32( 227 psVector* myData, ///< Vector containing the S32 values 228 psS32 low, ///< Minimum value 229 psS32 high ///< Maximum value 230 ); 231 232 /** Normalize the range of a vector containing S64 values */ 233 void p_psNormalizeVectorRangeS64( 234 psVector* myData, ///< Vector containing the S64 values 235 psS64 low, ///< Minimum value 236 psS64 high ///< Maximum value 237 ); 238 239 /** Normalize the range of a vector containing F32 values */ 240 void p_psNormalizeVectorRangeF32( 241 psVector* myData, ///< Vector containing the F32 values 242 psF32 low, ///< Minimum value 243 psF32 high ///< Maximum value 244 ); 245 246 /** Normalize the range of a vector containing F64 values */ 247 void p_psNormalizeVectorRangeF64( 248 psVector* myData, ///< Vector containing the F64 values 249 psF64 low, ///< Minimum value 250 psF64 high ///< Maximum value 251 ); 192 252 193 253 /// @}
Note:
See TracChangeset
for help on using the changeset viewer.
