diff options
Diffstat (limited to '')
-rw-r--r-- | src/FastRandom.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/FastRandom.h b/src/FastRandom.h index 7eecc698a..64a087c97 100644 --- a/src/FastRandom.h +++ b/src/FastRandom.h @@ -34,16 +34,16 @@ public: cFastRandom(void); - /// Returns a random int in the range [0 .. a_Range - 1]; a_Range must be less than 1M + /** Returns a random int in the range [0 .. a_Range - 1]; a_Range must be less than 1M */ int NextInt(int a_Range); - /// Returns a random int in the range [0 .. a_Range - 1]; a_Range must be less than 1M; a_Salt is additional source of randomness + /** Returns a random int in the range [0 .. a_Range - 1]; a_Range must be less than 1M; a_Salt is additional source of randomness */ int NextInt(int a_Range, int a_Salt); - /// Returns a random float in the range [0 .. a_Range]; a_Range must be less than 1M + /** Returns a random float in the range [0 .. a_Range]; a_Range must be less than 1M */ float NextFloat(float a_Range); - /// Returns a random float in the range [0 .. a_Range]; a_Range must be less than 1M; a_Salt is additional source of randomness + /** Returns a random float in the range [0 .. a_Range]; a_Range must be less than 1M; a_Salt is additional source of randomness */ float NextFloat(float a_Range, int a_Salt); /** Returns a random float between 0 and 1. */ @@ -55,8 +55,6 @@ public: private: std::minstd_rand m_LinearRand; - std::uniform_int_distribution<> m_IntDistribution; - std::uniform_real_distribution<float> m_FloatDistribution; }; @@ -69,15 +67,20 @@ public: MTRand(void); + /** Returns a random integer in the range [0 .. a_Range]. */ int randInt(int a_Range); + /** Returns a random integer in the range [0 .. MAX_INT]. */ int randInt(void); + /** Returns a random floating point number in the range [0 .. a_Range]. */ double rand(double a_Range); private: std::mt19937 m_MersenneRand; - std::uniform_int_distribution<> m_IntDistribution; - std::uniform_real_distribution<> m_DoubleDistribution; }; + + + + |