I am writing a class in c++ that uses a c++ rng to produce random numbers. The constructor takes the seed for the rng as an argument. However, when I expose the class to r using the rcpp package setting the seed does not work as I get different random numbers every time I instantiate a member of that class even though I pass the same seed. Is there a trick how to set the seed in c++ when using rcpp? Happy for all the help I can get.
Aucun commentaire:
Enregistrer un commentaire