Boost logo

Boost Users :

From: Jon Agiato (JonAgiato_at_[hidden])
Date: 2003-03-17 12:31:01


Hello all,

I am having difficulty in understanding the documentation regarding
the use of the pseudo-random number generators in boost::random.
Below, I have created a small sample program of the type I am trying
to create in order to use the various classes in boost::random with
Diehard (requires a binary file of 32 bit integers for testing).
This program does not compile as it says that mersenne_twister
requires template arguments. I understand what that means of
course, but am unsure as to what arguments should go in there. I am
using MSVC++ 7.0 and would really apprechiate any assistance.
Thanks!

#include <iostream>
using std::cout;
using std::cin;

#include <cstdlib>

#include <boost/random/mersenne_twister.hpp>
using boost::random::mersenne_twister;

#include <iomanip>
using std::ios;

#include <fstream>
using std::ofstream;

int main()
{
      ofstream file("MTRNG.bin", ios::binary);
      const unsigned int N = 10;
      unsigned int i = 0;
      mersenne_twister MT;
      for(; i != N; ++i)
      {
            file << MT;
      }

      cin.get();
      return EXIT_SUCCESS;
}

Jon Agiato
JonAgiato_at_[hidden]

[Non-text portions of this message have been removed]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net