Changeset 15261 for trunk/psLib/src/math/psRandom.h
- Timestamp:
- Oct 9, 2007, 10:05:32 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psRandom.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psRandom.h
r14452 r15261 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $10 * @date $Date: 2007- 08-09 01:40:07$9 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-10-09 20:05:32 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 * Contains information on the psRandom type and GNU Scientific Library random number generator. 38 38 */ 39 typedef struct 40 { 39 typedef struct { 41 40 psRandomType type; ///< The type of RNG 42 41 gsl_rng *gsl; ///< The RNG itself 43 } 44 psRandom; 42 } psRandom; 45 43 46 44 psU64 p_psRandomGetSystemSeed(); 47 45 48 46 /** Allocates a psRandom struct. 49 * 47 * 50 48 * @return psRandom*: A new psRandom structure. 51 49 */ … … 56 54 57 55 /** Resets an existing psRandom struct. 58 * 56 * 59 57 * @return void 60 58 */ … … 66 64 /** Random number generator based on a uniform distribution on [0,1). 67 65 * Uses gsl_rng_uniform. 68 * 66 * 69 67 * @return double: Random number. 70 68 */ … … 75 73 /** Random number generator based on a Gaussian deviate, N(0,1). 76 74 * Uses gsl_ran_gaussian. 77 * 75 * 78 76 * @return double: Random number. 79 77 */ … … 84 82 /** Random number generator based on a Gaussian deviate, N(0,1). 85 83 * Uses gsl_ran_gaussian. 86 * 84 * 87 85 * XXX: I created this since the above psLib spec for p_psRandomGaussian 88 86 * had no argument for sigma. Verify that with IfA. 89 * 87 * 90 88 * @return double: Random number. 91 89 */ … … 97 95 /** Random number generator based on a Poisson distribution with the given mean. 98 96 * Uses gsl_ran_poisson. 99 * 97 * 100 98 * @return double: Random number. 101 99 */ … … 105 103 ); 106 104 105 #define PS_ASSERT_RANDOM_NON_NULL(NAME, RVAL) \ 106 if (!(NAME) || !(NAME)->gsl) { \ 107 psError(PS_ERR_UNEXPECTED_NULL, true, "Error: Random number generator %s is NULL", #NAME); \ 108 return RVAL; \ 109 } 110 107 111 /// @} 108 112 #endif // #ifndef PS_RANDOM_H
Note:
See TracChangeset
for help on using the changeset viewer.
