Changeset 3389 in Sophya for trunk/SophyaLib/BaseTools/srandgen.h
- Timestamp:
- Nov 22, 2007, 6:20:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/srandgen.h
r3364 r3389 84 84 #endif 85 85 86 /* -- Declaration d'une classe pour la centralier la doc -- Oct 2006 */87 #ifdef __cplusplus88 namespace SOPHYA {89 class RandomGenerator {90 public:91 /*! \brief Automatic initialization through Auto_Ini_Ranf() */92 static inline void AutoInit(int lp=0) { Auto_Ini_Ranf(lp); return; }93 /*! \brief Return a random number \b r with a flat distribution 0<=r<=1 */94 static inline double Flat01() { return drand48(); }95 /*! \brief Return a random number \b r with a flat distribution -1<=r<=1 */96 static inline double Flatpm1() { return drandpm1(); }97 /*! \brief Return a random number following a zero mean gaussian distribution */98 static inline double Gaussian(double sigma=1.) { return GauRnd(0., sigma); }99 /*! \brief Return a random number following a Poisson distribution with mean \b mu */100 static inline int Poisson(double mu) { return PoissRand(mu); }101 };102 } /* namespace SOPHYA */103 86 #endif 104 87 105 #endif106
Note:
See TracChangeset
for help on using the changeset viewer.