0

I want to implement MT alg in CPP (I just can't use C++11 sadly) I've found a lot of algorithms like SFMT, dSFMT, some versions of Tiny MT etc; but as I saw the documentation of those algs, I think they works for range like <0,2) (from doxygen documentation)

Need any ideas how to replace basic RNG algorithm

SRAND(TIME(NULL))

With something better

Paul R
  • 208,748
  • 37
  • 389
  • 560
Bartłomiej Sobieszek
  • 2,692
  • 2
  • 25
  • 40

2 Answers2

1

Boost.Random provides quite a few thread-safe random generators, and they work with C++98.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271
1

If you dont want Boost dependency there are multiple standalone MT implementations

Mersenne Twister 1

Mersenne Twister 2

Mersenne Twister 3..n

Blaz Bratanic
  • 2,279
  • 12
  • 17