Boost logo

Boost Users :

From: scleary_at_[hidden]
Date: 2003-03-17 12:49:31


> -----Original Message-----
> From: Jon Agiato [mailto:JonAgiato_at_[hidden]]
>
> 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!

The Boost.Random library defines fully-generic random number generator
algorithms, e.g., boost::random::mersenne_twister,
boost::random::linear_congruential, etc. These are only for advanced users.

The Boost.Random library also provides specializations of those generic
random number generator algorithms for use by normal users. e.g.,
boost::mt19937 and boost::mt11213b are both specializations of the Mersenne
twister; and boost::minstd_rand is a specialization of the linear
congruential algorithm.

So, unless you have really exceptional random number requirements, you
should be using boost::mt19937 instead of boost::random::mersenne_twister:

> using boost::random::mersenne_twister;

using boost::mt19937;

> mersenne_twister MT;

mt19937 MT;

Then your example should compile.
        -Steve


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