Boost logo

Boost :

Subject: [boost] [random] Seeding again
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-11-06 00:05:42


AMDG

The attached patch allows random number generators
to be seeded with any value. Currently linear_congruential
and a few other generators can assert for some seeds.
(For instance minstd_rand cannot be seeded with 0).

For linear_congruential I am using the algorithm described
in n2960, section 26.5.3.1/4. For linear_feedback_shift
I use a similar idea, adding 2^(w-k) if the seed is less than
2^(w-k). The behavior of any code that was valid before,
should be unaffected by this change.

The patch includes test and documentation updates. The
tests pass with gcc, msvc, and como. I think it's ready
to go now.

Okay to commit?

In Christ,
Steven Watanabe




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk