Mersenne Twister Seeding and UUIDs

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jun 11 11:09:26 PDT 2012


On 6/11/12 12:32 PM, Joseph Rushton Wakeling wrote:
> On 11/06/12 18:15, Johannes Pfau wrote:
>> Could someone who's familiar with RNGs answer this question? This seems
>> to be important for st.uuid, we should get this right.
>
> In the Boost C++ implementation it certainly accepts a range as input:
>
> template<class It>
> void seed(It& first, It last)
> {
> int j;
> for(j = 0; j < n && first != last; ++j, ++first)
> x[j] = *first;
> i = n;
> if(first == last && j < n)
> throw std::invalid_argument("mersenne_twister::seed");
> }
>
> Some information on the seeding issue can be found here:
> http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html

We should have the same in std.random. Could anyone please initiate a 
pull request?

Thanks,

Andrei


More information about the Digitalmars-d mailing list