daqana / dqrng

Fast Pseudo Random Number Generators for R
https://daqana.github.io/dqrng/
Other
42 stars 8 forks source link

std::random_device on Windows #2

Closed rstub closed 6 years ago

rstub commented 6 years ago

Test if package is affected by this mingw bug.

rstub commented 6 years ago

Yes, dqrng is affected:

>"c:\Program Files\R\R-3.4.3\bin\Rscript.exe" -e "dqrng::dqrunif(3)"
[1] 0.33636694 0.03425955 0.82737366

>"c:\Program Files\R\R-3.4.3\bin\Rscript.exe" -e "dqrng::dqrunif(3)"
[1] 0.33636694 0.03425955 0.82737366

>"c:\Program Files\R\R-3.4.3\bin\Rscript.exe" -e "dqrng::dqrunif(3)"
[1] 0.33636694 0.03425955 0.82737366

If you do not set a seed, std::random_device is used to initialize the RNG. Since that is deterministic with mingw, the RNGs from dqrng are also deterministic on Windows.