88 |
|
|
89 |
|
//Methods |
90 |
|
public: |
91 |
< |
MTRand( const uint32& oneSeed, int nstrides = 1, int stride = 0); // initialize with a simple uint32 |
92 |
< |
MTRand( uint32 *const bigSeed, uint32 const seedLength = N, int nstrides = 1, int stride = 0); // or an array |
93 |
< |
MTRand(int nstrides = 1, int stride = 0); // auto-initialize with /dev/urandom or time() and clock() |
91 |
> |
MTRand( const uint32& oneSeed, int nstrides, int stride); // initialize with a simple uint32 |
92 |
> |
MTRand( uint32 *const bigSeed, uint32 const seedLength, int nstrides, int stride); // or an array |
93 |
> |
MTRand(int nstrides, int stride); // auto-initialize with /dev/urandom or time() and clock() |
94 |
|
|
95 |
|
// Do NOT use for CRYPTOGRAPHY without securely hashing several returned |
96 |
|
// values together, otherwise the generator state can be learned after |
198 |
|
*/ |
199 |
|
inline MTRand::uint32 MTRand::randInt() { |
200 |
|
|
201 |
< |
uint32 ranNums[nstrides_]; |
201 |
> |
std::vector<uint32> ranNums(nstrides_); |
202 |
|
|
203 |
|
for (int i = 0; i < nstrides_; ++i) { |
204 |
|
ranNums[i] = rawRandInt(); |