RcppParallel icon indicating copy to clipboard operation
RcppParallel copied to clipboard

How to set random seed using RcppParallel and RcppArmadillo to permutation

Open xiangpin opened this issue 2 years ago • 1 comments

Good Day

I am using RcppParallel and the shuffle function of RcppArmadillo to shuffle vec, But the result is not repeatable even I used the set.seed of R or the withr::with_seed or arma::set_seed in the C++ codes. To be reproducible, is there a function like set.seed of R base to do this? Thank you.

xiangpin avatar Oct 25 '23 14:10 xiangpin

Dealing with RNG's in parallel is a non-trivial tasks. As such, I would look at the library dqrng here: https://github.com/daqana/dqrng

jwood000 avatar Oct 25 '23 14:10 jwood000