00001 #pragma once 00002 #ifndef PARKMILLER_H 00003 #define PARKMILLER_H 00004 00005 #include "../../common/types.h" 00006 #include "RandomGenerator.h" 00007 00008 const LongInteger a = 16807; 00009 const LongInteger m = 2147483647; 00010 const LongInteger q = 127773; 00011 const LongInteger r = 2836; 00012 00013 class ParkMiller : public RandomGenerator 00014 { 00015 public: 00016 00018 ParkMiller(LongNatural Seed_=0); 00019 ~ParkMiller(); 00020 00022 LongNatural GetOneRandomInteger(); 00023 00025 Real getUniform(); 00026 00028 void SetSeed(LongNatural Seed); 00029 00031 VeryLongNatural Max(); 00033 LongNatural Min(); 00034 00035 private: 00036 LongNatural Seed; 00037 }; 00038 00039 #endif