daqana / dqrng

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

Support more xo(ro)shiro RNGs #56

Closed rstub closed 1 year ago

rstub commented 1 year ago

Currently only xoroshiro128+ and xoshiro256+ from https://prng.di.unimi.it/ are supported. These RNGs should only be used for creating floating point numbers, which was the case for {dqrng} originally. However, dqsample and dqrrademacher make use of the full bit pattern. So it would be better to support the ** and/or ++ variants and make one of them the default. This would be a breaking change, of course.

In addition, the templating mechanism in xoshiro.h does not really work. Probably best to resort to a simpler template with just the state size and a virtual next() which is then explicitly implemented in per-RNG derived classes.