golosio / xrmc

17 stars 10 forks source link

randmt: fix bug in init_randmt_auto_r #38

Closed tschoonj closed 6 years ago

tschoonj commented 6 years ago

@golosio there is a serious bug in the randmt library: init_randmt_auto_r doesn't actually set the generated seed to the rng instance, and instead uses it for the global rng...

I fixed the bug, and removed all code involving the global rng, to ensure this kind of problem cannot occur again.

I also warned the author of randmt about this bug.

I will also push a commit with a different mechanism to generate high quality seeds as I am not happy with the algorithm that is used here: the seeds are all very similar...

golosio commented 6 years ago

Thank you for dealing with this issue Tom, I agree with all your changes.

tschoonj commented 6 years ago

Many thanks Bruno! If you use this code anywhere else, you should update it there as well.