SimpleRandomNumberGenerator.h

Go to the documentation of this file.
00001 #ifndef SIMPLERANDOMNUMBERGENERATOR_H_
00002 #define SIMPLERANDOMNUMBERGENERATOR_H_
00003 
00004 class SimpleRandomNumberGenerator
00005 {
00006 
00007 public:
00008     SimpleRandomNumberGenerator()  { iset = 0; idum2=123456789; iy=0; };
00009 
00010     //  virtual ~SimpleRandomNumberGenerator();
00011 
00012 public:
00013 
00014     double uniformRand();
00015     double uniformRand(double a, double b){ return a+(b-a)* uniformRand(); };
00016 
00017     int uniformRandInt(int a, int b) { return (int)(a+(b-a)* uniformRand()+0.5); };
00018 
00019     double normalRand();
00020     double normalRand(double mu, double sigma) { return mu + sigma * normalRand(); };
00021 
00022     void seed(long idum);
00023 
00024 private:
00025     double uniform_rand(long *idum);
00026 
00027     long idum2;
00028     long iy;
00029 #define NTAB 32
00030     long iv[NTAB];
00031 
00032     long IDUM;
00033     int iset;
00034     double gset;
00035 
00036 };
00037 
00038 #endif /*SIMPLERANDOMNUMBERGENERATOR_H_*/

Generated on Wed Jul 9 16:34:39 2008 for PCSIM by  doxygen 1.5.5