Is continuously seeding a random number generator performance intensive?

Jeroen Bollen jbinero at gmail.com
Tue Jan 21 09:13:38 PST 2014


On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote:
> On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen 
> wrote:
>> How do you correctly create a MersenneTwisterEngine with a 
>> ulong as seed?
>
> This question still isn't answered by the way.

Come on, surely someone knows how to. I've already tried the 
obvious, but it doesn't work.

MersenneTwisterEngine!(ulong, 32, 624, 397, 31, 0x9908b0df, 11, 
7, 0x9d2c5680, 15, 0xefc60000, 18) rndEngine;
rndEngine = MersenneTwisterEngine(seed);

"shift by 32 is outside the range 0..31"
"static assert  (false && 4022730752LU <= 0LU) is false"
"instantiated from here: MersenneTwisterEngine!(ulong, 32, 624, 
397, 31, 2567483615u, 11, 7, 2636928640u, 15, 4022730752u, 18)"



More information about the Digitalmars-d-learn mailing list