
8 Mar
2010
8 Mar
'10
10:39 a.m.
Hi David, You need to seed the random number generator upon creation, default contructed it will always be in the same state. Best, Dee On Mon, Mar 8, 2010 at 4:29 PM, David Kaplan <davkaplan@gmail.com> wrote:
I'm using the following code to generate a random 64 bit value:
boost::mt19937 rng; boost::uniform_int<uint64_t> r(0,0xffffffffffffffff); boost::variate_generator<boost::mt19937&, boost::uniform_int<uint64_t> > gen(rng, r); uint64_t id = gen();
However it seems it's not random on each execution of the program? (rather I get the same value again). How do I randomise this properly?
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users