We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c78037 commit 32fee19Copy full SHA for 32fee19
src/ccutil/helpers.h
@@ -68,7 +68,9 @@ inline const std::vector<std::string> split(const std::string &s, char c) {
68
return v;
69
}
70
71
-// A simple linear congruential random number generator.
+// A simple linear congruential random number generator,
72
+// using Knuth's constants from:
73
+// http://en.wikipedia.org/wiki/Linear_congruential_generator.
74
class TRand {
75
public:
76
// Sets the seed to the given value.
@@ -95,7 +97,10 @@ class TRand {
95
97
96
98
99
private:
- std::minstd_rand e;
100
+ std::linear_congruential_engine<std::uint_fast32_t,
101
+ 6364136223846793005ULL,
102
+ 1442695040888963407ULL,
103
+ UINT64_MAX> e;
104
};
105
106
// Remove newline (if any) at the end of the string.
0 commit comments