random number generation: the newbie asks for advice

geoff at elj.com geoff at elj.com
Thu Dec 30 02:47:01 EST 1999


In article <slrn86l5e5.7vq.neelk at brick.cswv.com>,
  neelk at alum.mit.edu wrote:
> Alex Martelli <Alex.Martelli at think3.com> wrote:
> >
> >Is there a decent, Python-interfaced, C-written, stand-alone random
> >number generator, with persistable/de-persistable state?  Or am I
> >being too suspicious of ranlibmodule's quality and should just try to
> >yank it out of "Numeric" for a smaller set of dependencies...?
> >
> >Advice is welcome!
>
> Sounds like you want the Mersenne Twister! From the webpage:
>
>   Mersenne Twister(MT) is a pseudorandom number generator developped
>   by Makoto Matsumoto and Takuji Nishimura (alphabetical order) during
>   1996-1997. MT has the following merits:
[..]
> The C source is available at:
>
> http://www.math.keio.ac.jp/~matumoto/emt.html
>
> Unfortunately, I don't think it has a Python wrapper yet. It should be
> easy to implement, though, since there's only a pair of very small C
> functions to wrap.

Should be quite easy to port Python.

There is an Eiffel (using SmallEiffel http://smalleiffel.loria.fr/ )
wrapper available from the Eiffel Forum Archive at:

   http://www.eiffel-forum.org/archive/wagner/twister.htm

Hope this helps.

Geoff Eldridge

-- email: geoff at elj.com
-- elj-daily: http://www.elj.com/elj-daily.cgi


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list