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
RevLine 
[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]15namespace SOPHYA {
[3099]16
[851]17
[3615]18inline double drand01()
19 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flat01();}
20inline double drandpm1()
21 {return RandomGeneratorInterface::GetGlobalRandGenP()->Flatpm1();}
[851]22
[3615]23inline double NorRand()
24 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian();}
25inline double Gaussian(double sigma,double mu)
26 {return RandomGeneratorInterface::GetGlobalRandGenP()->Gaussian(sigma,mu);}
[851]27
[3615]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);}
[851]34
[3615]35inline double Poisson(double mu, double mumax=-1)
36 {return RandomGeneratorInterface::GetGlobalRandGenP()->Poisson(mu,mumax);}
[851]37
[3615]38inline double Exponential()
39 {return RandomGeneratorInterface::GetGlobalRandGenP()->Exponential();}
[851]40
[3615]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);}
[3099]45
[3615]46inline void AutoInitRand(int lp)
47 {return RandomGeneratorInterface::GetGlobalRandGenP()->AutoInit(lp);}
[851]48
[3615]49inline void ShowRandom()
50 {return RandomGeneratorInterface::GetGlobalRandGenP()->ShowRandom();}
[851]51
[3615]52} /* namespace SOPHYA */
53
[851]54#endif
Note: See TracBrowser for help on using the repository browser.