Mersienne Twister

Derek Parnell derek at psych.ward
Thu Apr 13 10:25:16 PDT 2006


On Fri, 14 Apr 2006 00:38:42 +1000, James Dunne <james.jdunne at gmail.com>  
wrote:

> 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
>>
>
> Did you get this from Torus Trooper?  If not then that's highly  
> coincidental.
>

I got it from Makoto's RNG site ...

    http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html

-- 
Derek Parnell
Melbourne, Australia



More information about the Digitalmars-d-announce mailing list