Mersienne Twister
Victor Nakoryakov
nail-mail at mail.ru
Thu Apr 13 08:43:04 PDT 2006
Derek Parnell wrote:
>
> I did a port of the Mersienne Twister (C-language edition) by Takuji
> Nishimura and Makoto Matsumoto into D. It is a free function version
> and doesn't use any classes. It also has a template for ranged random
> numbers.
>
> eg..
> uint v = genrand_range!(uint)(1, 10));
> double f = genrand_range!(double)(-0.5, 0.5))
>
> It can be found at
>
> http://www.users.bigpond.com/ddparnell/mt.d
>
> To get the object file only, compile with
>
> dmd -c mt
>
> to get a stand alone self-test version compile with
>
> dmd -version=main mt
>
Hey... I've already implement it in 'helix' on dsource. It is in svn.
I'll test your implementation on weekend to see which is faster :)
--
Victor (aka nail) Nakoryakov
nail-mail<at>mail<dot>ru
Krasnoznamensk, Moscow, Russia
More information about the Digitalmars-d-announce
mailing list