Mir Random [WIP]

Joseph Rushton Wakeling via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 23 05:45:15 PST 2016


On Wednesday, 23 November 2016 at 13:35:33 UTC, Ilya Yaroshenko 
wrote:
> 1. Current default RNG (Mt19937) has not state for the latest 
> value.

That's a detail of your implementation, though, and it's not true 
for lots of other pseudo-RNGs.

> 2. The structure is allocated on stack and compilers can 
> recognise loop patterns and eliminate addition memory movements 
> for many cases.

Fair enough.  I'm still not sure, though, why you would object to 
providing public methods for pseudo-RNGs to (i) update the 
internal state and (ii) access the most recently generated 
variate, which the `opCall` would then wrap.


More information about the Digitalmars-d mailing list