Changeset 3615 in Sophya for trunk/SophyaLib/BaseTools/randinterf.h
- Timestamp:
- May 1, 2009, 1:34:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/randinterf.h
r3612 r3615 110 110 111 111 // --- Le tirage gaussien complexe (cf texte a la fin du .cc) 112 inline complex< r_8 > ComplexGauss Ran(void)112 inline complex< r_8 > ComplexGaussian(void) 113 113 {return complex< r_8 >(Gaussian(),Gaussian());} 114 inline complex< r_8 > ComplexGauss Ran(double sig)114 inline complex< r_8 > ComplexGaussian(double sig) 115 115 {return complex< r_8 >(sig*Gaussian(),sig*Gaussian());} 116 116 /*! \brief Returns the module of a random complex number generated by ComplexGaussRan */ 117 inline double ModComplexGauss Ran(double sig=1.)117 inline double ModComplexGaussian(double sig=1.) 118 118 {double r=-log(1.-Next()); return sig*sqrt(2.*r);} 119 119 120 //! Return the pointer to the default global RandomGenerator object 120 // --- Le tirage sur une distribution gaussienne a 2D 121 /*! \brief Return 2 random numbers following a gaussian 2D distribution */ 122 virtual int Gaussian2DRho(double &x,double &y,double mx,double my,double sx,double sy,double ro); 123 virtual void Gaussian2DAng(double &x,double &y,double mx,double my,double sa,double sb,double teta); 124 125 //! Return the pointer to the default global RandomGenerator object 121 126 static inline RandomGeneratorInterface* GetGlobalRandGenP() 122 127 { return gl_rndgen_p; } 123 128 124 // Permet de definir l'instance global du generateur aleatoire 129 //! Initialisation automatique 130 virtual void AutoInit(int lp=0); 131 132 //! Print 133 virtual void ShowRandom(); 134 135 // Permet de definir l'instance global du generateur aleatoire 125 136 static void SetGlobalRandGenP(RandomGeneratorInterface* rgp); 126 137
Note:
See TracChangeset
for help on using the changeset viewer.