[3615] | 1 | /* fonctions pour generateurs aleatoires cmv 23/06/94 */
|
---|
| 2 | /* Copie de nbrand.h .c .Ansari 04/2000 */
|
---|
| 3 | /* interface avec RandomGeneratorInterface cmv 04/2009 */
|
---|
[851] | 4 |
|
---|
| 5 | #ifndef SRANDGEN_H_SEEN
|
---|
| 6 | #define SRANDGEN_H_SEEN
|
---|
| 7 |
|
---|
| 8 | #include "machdefs.h"
|
---|
| 9 | #include <stdlib.h>
|
---|
[3615] | 10 | #include <complex>
|
---|
| 11 | #include "randinterf.h"
|
---|
[851] | 12 |
|
---|
[3615] | 13 | /* Declaration en fonctions inline interface avec RandomGeneratorInterface global*/
|
---|
[2323] | 14 |
|
---|
[3615] | 15 | namespace SOPHYA {
|
---|
[3099] | 16 |
|
---|
[851] | 17 |
|
---|
[3615] | 18 | inline double drand01()
|
---|
| 19 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Flat01();}
|
---|
| 20 | inline double drandpm1()
|
---|
| 21 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Flatpm1();}
|
---|
[851] | 22 |
|
---|
[3615] | 23 | inline double NorRand()
|
---|
| 24 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian();}
|
---|
| 25 | inline double Gaussian(double sigma,double mu)
|
---|
| 26 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian(sigma,mu);}
|
---|
[851] | 27 |
|
---|
[3615] | 28 | inline complex< r_8 > ComplexGaussian()
|
---|
| 29 | {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian();}
|
---|
| 30 | inline complex< r_8 > ComplexGaussian(double sig)
|
---|
| 31 | {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian(sig);}
|
---|
| 32 | inline double ModComplexGaussian(double sig=1.)
|
---|
| 33 | {return RandomGeneratorInterface::GetGlobalRandGenP()->ModComplexGaussian(sig);}
|
---|
[851] | 34 |
|
---|
[3615] | 35 | inline double Poisson(double mu, double mumax=-1)
|
---|
| 36 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Poisson(mu,mumax);}
|
---|
[851] | 37 |
|
---|
[3615] | 38 | inline double Exponential()
|
---|
| 39 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Exponential();}
|
---|
[851] | 40 |
|
---|
[3615] | 41 | inline int Gaussian2DRho(double &x,double &y,double mx,double my,double sx,double sy,double ro)
|
---|
| 42 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian2DRho(x,y,mx,my,sx,sy,ro);}
|
---|
| 43 | inline void Gaussian2DAng(double &x,double &y,double mx,double my,double sa,double sb,double teta)
|
---|
| 44 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian2DAng(x,y,mx,my,sa,sb,teta);}
|
---|
[3099] | 45 |
|
---|
[3615] | 46 | inline void AutoInitRand(int lp)
|
---|
| 47 | {return RandomGeneratorInterface::GetGlobalRandGenP()->AutoInit(lp);}
|
---|
[851] | 48 |
|
---|
[3615] | 49 | inline void ShowRandom()
|
---|
| 50 | {return RandomGeneratorInterface::GetGlobalRandGenP()->ShowRandom();}
|
---|
[851] | 51 |
|
---|
[3615] | 52 | } /* namespace SOPHYA */
|
---|
| 53 |
|
---|
[851] | 54 | #endif
|
---|