Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

LC_RNGs.h

Go to the documentation of this file.
00001 
00010 #ifndef _H_LC_RNGS
00011 #define _H_LC_RNGS
00012 
00013 #include <cstdlib>
00014 #include <cmath>
00015 #include "generators.h"
00016 
00017 namespace generators {
00018 
00027         class LC_RNG: public generators::RNG {
00028 
00029         protected:
00030 
00034                 unsigned int _a, _c, _m;
00035 
00045                 virtual unsigned int nextInt();
00046 
00053                 virtual unsigned int linear_congruential( unsigned int x );
00054 
00055         public:
00062                 LC_RNG();
00063 
00071                 LC_RNG(unsigned int a, unsigned int c, unsigned int m);
00072 
00073                 virtual ~LC_RNG() {}
00074 
00076                 virtual unsigned int getA();
00077 
00079                 virtual unsigned int getC();
00080 
00082                 virtual unsigned int getM();
00083 
00085                 virtual unsigned int getMaximum();
00086         };
00087 
00088 
00089 // -- Next, several specific RNGs as derived classes. ---------------------
00090 
00094         class RANDU: public generators::LC_RNG {
00095         public:
00096                 RANDU();
00097 
00098                 virtual ~RANDU() {}
00099         };
00100 
00107         class QUICK: public LC_RNG {
00108         public:
00109                 QUICK();
00110 
00111                 virtual ~QUICK() {}
00112         };
00113 };
00114 
00115 #endif
00116 

Generated on Fri Sep 4 18:03:45 2009 for LabSci RNG/MC generators by  doxygen 1.3.9.1