- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psLib/src/math/psRandom.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psLib/src/math/psRandom.h
r15627 r23352 29 29 #include <gsl/gsl_randist.h> 30 30 31 / ** Enumeration containing a flag for psRandom types. */31 /// Random number generator types 32 32 typedef enum { 33 33 PS_RANDOM_TAUS ///< A maximally equidistributed combined Tausworthe generator. 34 34 } psRandomType; 35 35 36 /** Data structure for psRandom. 37 * Contains information on the psRandom type and GNU Scientific Library random number generator. 38 */ 36 /// Random number generator 39 37 typedef struct { 40 38 psRandomType type; ///< The type of RNG … … 48 46 ); 49 47 50 /** Allocates a psRandom struct. 51 * 52 * @return psRandom*: A new psRandom structure. 53 */ 48 /// Set the seed to use for random number generators. 49 /// 50 /// A seed value of zero indicates that the seed is to be generated from the system. 51 /// The new seed value is returned 52 psU64 psRandomSeed(psU64 seed ///< Seed for RNG 53 ); 54 55 /// Allocate a random number generator 56 /// 57 /// The currently defined seed (via psRandomSeed) is used 54 58 psRandom *psRandomAlloc( 55 psRandomType type, ///< The type of RNG 56 unsigned long seed ///< Known value with which to seed the RNG 59 psRandomType type ///< The type of RNG 57 60 ) PS_ATTR_MALLOC; 58 61 59 /** Resets an existing psRandom struct. 60 * 61 * @return void 62 */ 63 void psRandomReset( 64 psRandom *rand, ///< Existing psRandom struct to reset 65 unsigned long seed ///< Known value with which to seed the RNG 62 /// Allocate a random number generator with a specific seed 63 /// 64 /// A seed value of zero indicates that the seed is to be generated from the system. 65 psRandom *psRandomAllocSpecific(psRandomType type, ///< The type of RNG 66 psU64 specificSeed ///< The specific seed to use 67 ); 68 69 /// Resets an existing random number generator 70 bool psRandomReset( 71 psRandom *rand ///< Random number generator to reset 66 72 ); 67 73 … … 72 78 */ 73 79 double psRandomUniform( 74 const psRandom *r ///< psRandom struct for RNG80 const psRandom *r ///< Random number generator 75 81 ); 76 82 … … 81 87 */ 82 88 double psRandomGaussian( 83 const psRandom *r ///< psRandom struct for RNG89 const psRandom *r ///< Random number generator 84 90 ); 85 91 86 /** Random number generator based on a Gaussian deviate , N(0,1).92 /** Random number generator based on a Gaussian deviate with specified standard deviation. 87 93 * Uses gsl_ran_gaussian. 88 *89 * XXX: I created this since the above psLib spec for p_psRandomGaussian90 * had no argument for sigma. Verify that with IfA.91 94 * 92 95 * @return double: Random number. 93 96 */ 94 97 double p_psRandomGaussian( 95 const psRandom *r, ///< psRandom struct for RNG98 const psRandom *r, ///< Random number generator 96 99 double sigma 97 100 ); … … 103 106 */ 104 107 double psRandomPoisson( 105 const psRandom *r, ///< psRandom struct for RNG108 const psRandom *r, ///< Random number generator 106 109 double mean ///< Mean value 107 110 );
Note:
See TracChangeset
for help on using the changeset viewer.
