Changeset 3389 in Sophya for trunk/SophyaLib/BaseTools/srandgen.h


Ignore:
Timestamp:
Nov 22, 2007, 6:20:04 PM (18 years ago)
Author:
cmv
Message:

intro classe RandomGenerator , cmv+rz 22/11/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/srandgen.h

    r3364 r3389  
    8484#endif
    8585
    86 /* -- Declaration d'une classe pour la centralier la doc -- Oct 2006 */
    87 #ifdef __cplusplus
    88 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 */
    10386#endif
    10487
    105 #endif
    106 
Note: See TracChangeset for help on using the changeset viewer.