[Numpy-discussion] Purpose for bit-wise and'ing the initial mersenne twister key?

Michael S. Gilbert michael.s.gilbert@gmail....
Thu Feb 12 14:46:21 CST 2009


On Thu, 12 Feb 2009 14:32:02 -0600 Robert Kern wrote:
>> You could also think of it the other way (in terms of generating 64-bit
>> ints). Instead of generating two 32-bit rints and concatenating them
>> for a 64-bit int, you can just directly generate the 64-bit int. Since
>> the 64-bit int requires only slightly more time to generate than either
>> of the 32-bit ints individually, an almost 2x speedup is achieved.
>
><shrug> I'll believe it when I see it.

I'll put together a proof of concept when I have the time.

> Some people don't think so. People have asked for more stringent
> compatibility than we can already provide (i.e. replicability even in
> the face of bug fixes). People use these as inputs to their scientific
> simulations. I'm not going to intentionally make their lives harder
> than that.
> 
> Bruce Southey was working on exposing the innards a bit so that you
> could make use the a different core PRNG while reusing the
> numpy-specific stuff in RandomState. That would be the approach to
> apply different technologies.

This would be very useful.  A "backward-compatibility=<numpy version
number>" flag could be offered to fall back to a particular
implementation so that you can push forward and still offer
compatibility as needed.

Regards,
Mike


More information about the Numpy-discussion mailing list