randomNumberGenerator.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2 sw=2
00003 //
00004 // $Id: randomNumberGenerator.h,v 1.1.18.1 2007/03/25 21:23:46 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_MATHS_RANDOMNUMBERGENERATOR_H
00008 #define BALL_MATHS_RANDOMNUMBERGENERATOR_H
00009 
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013 
00014 #include<vector>
00015 
00016 namespace BALL
00017 {
00018 
00063   class BALL_EXPORT RandomNumberGenerator
00064   {
00065 
00066     public:
00067 
00069       RandomNumberGenerator();
00070 
00072       RandomNumberGenerator(const RandomNumberGenerator& rng);
00073 
00075       ~RandomNumberGenerator();
00076 
00077       void setup(int ij = 1802, int kl = 9373);
00078 
00083       double randomUniform();
00084 
00095       double randomGaussian(double mean, double stddev);
00096 
00099       int randomInteger(int lower, int upper);
00100 
00103       double randomDouble(double lower, double upper);
00104 
00106       bool isValid()
00107         
00108       {
00109         return(valid_);
00110       }
00111 
00112     private:
00113 
00114       //_
00115       std::vector<double> u_;
00116 
00117       //_
00118       double c_;
00119 
00120       //_
00121       double cd_;
00122 
00123       //_
00124       double cm_;
00125 
00126       //_
00127       int i97_;
00128 
00129       //_
00130       int j97_;
00131 
00132       //_ 
00133       bool valid_;
00134 
00135 
00136   };
00137 }
00138 
00139 #endif //  BALL_MATHS_RANDOMNUMBERGENERATOR_H
00140