source: Sophya/trunk/SophyaLib/BaseTools/srandgen.h@ 3615

Last change on this file since 3615 was 3615, checked in by cmv, 16 years ago

Modifs relatives a l'introduction de RandomGeneratorInterface + delete de srandgen.c, cmv 01/05/2009

File size: 2.0 KB
Line 
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
15namespace SOPHYA {
16
17
18inline double drand01()
19 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flat01();}
20inline double drandpm1()
21 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flatpm1();}
22
23inline double NorRand()
24 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian();}
25inline double Gaussian(double sigma,double mu)
26 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian(sigma,mu);}
27
28inline complex< r_8 > ComplexGaussian()
29 {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian();}
30inline complex< r_8 > ComplexGaussian(double sig)
31 {return RandomGeneratorInterface::GetGlobalRandGenP()->ComplexGaussian(sig);}
32inline double ModComplexGaussian(double sig=1.)
33 {return RandomGeneratorInterface::GetGlobalRandGenP()->ModComplexGaussian(sig);}
34
35inline double Poisson(double mu, double mumax=-1)
36 {return RandomGeneratorInterface::GetGlobalRandGenP()->Poisson(mu,mumax);}
37
38inline double Exponential()
39 {return RandomGeneratorInterface::GetGlobalRandGenP()->Exponential();}
40
41inline 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);}
43inline 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
46inline void AutoInitRand(int lp)
47 {return RandomGeneratorInterface::GetGlobalRandGenP()->AutoInit(lp);}
48
49inline void ShowRandom()
50 {return RandomGeneratorInterface::GetGlobalRandGenP()->ShowRandom();}
51
52} /* namespace SOPHYA */
53
54#endif
Note: See TracBrowser for help on using the repository browser.