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 */
|
---|
4 |
|
---|
5 | #ifndef SRANDGEN_H_SEEN
|
---|
6 | #define SRANDGEN_H_SEEN
|
---|
7 |
|
---|
8 | #include "machdefs.h"
|
---|
9 | #include <stdlib.h>
|
---|
10 | #include <complex>
|
---|
11 | #include "randinterf.h"
|
---|
12 |
|
---|
13 | /* Declaration en fonctions inline interface avec RandomGeneratorInterface global*/
|
---|
14 |
|
---|
15 | namespace SOPHYA {
|
---|
16 |
|
---|
17 |
|
---|
18 | inline double drand01()
|
---|
19 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Flat01();}
|
---|
20 | inline double drandpm1()
|
---|
21 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Flatpm1();}
|
---|
22 |
|
---|
23 | inline double NorRand()
|
---|
24 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian();}
|
---|
25 | inline double Gaussian(double sigma,double mu)
|
---|
26 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian(sigma,mu);}
|
---|
27 |
|
---|
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);}
|
---|
34 |
|
---|
35 | inline double Poisson(double mu, double mumax=-1)
|
---|
36 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Poisson(mu,mumax);}
|
---|
37 |
|
---|
38 | inline double Exponential()
|
---|
39 | {return RandomGeneratorInterface::GetGlobalRandGenP()->Exponential();}
|
---|
40 |
|
---|
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);}
|
---|
45 |
|
---|
46 | inline void AutoInitRand(int lp)
|
---|
47 | {return RandomGeneratorInterface::GetGlobalRandGenP()->AutoInit(lp);}
|
---|
48 |
|
---|
49 | inline void ShowRandom()
|
---|
50 | {return RandomGeneratorInterface::GetGlobalRandGenP()->ShowRandom();}
|
---|
51 |
|
---|
52 | } /* namespace SOPHYA */
|
---|
53 |
|
---|
54 | #endif
|
---|