This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Mersenne Twister (Bug?)


Thanks. I've just checked the original developers website and they
have released an updated version of MT19937 to fix the weakness in the
seeding procedure.  I shall update the GSL version accordingly.  I've
attached their new procedure below.  

It would be worthwhile to run tests for bad seeds across all the
generators, to supplement the serial tests from DIEHARD.  I shall add
that to the TODO list.

best regards

Brian Gough


/* Initializing the array with a seed */
void
sgenrand(seed)
    unsigned long seed; 
{
    int i;

    for (i=0;i<N;i++) {
         mt[i] = seed & 0xffff0000;
         seed = 69069 * seed + 1;
         mt[i] |= (seed & 0xffff0000) >> 16;
         seed = 69069 * seed + 1;
    }
    mti = N;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]