Mersenne Twister Class

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Mersenne Twister Class

      I should preface this by saying I'm on the noob end of understanding C++.

      I see the description of the mersenne twister class, but the functions are never actually defined... Are we left to our own devices to implement each function, based on its name? I realize there is mersenne twister code to download online (I've used some myself), but it's not exacatly clear what the purpose of providing a class declaration is, without including the workings of it. Like I said, I'm pretty new to C++, so go easy. Thanks!
    • Are you talking about the GCCRandom class in chapter 3? You can find the definition in Math_Random.cpp in the source code for the book, which can be found here:
      code.google.com/p/gamecode4/

      We didn't include the code in the book because there wasn't space. There are thousands of lines of code in the GCC code base so it's impossible for us to include it all, we have to pick & choose the pieces we find the most important. In this case, we're not trying to teach you how to implement the Mersenne Twister algorithm, we just wanted to show you the interface for generating random numbers.

      -Rez