[Rcpp-devel] for loop and random draws

Dirk Eddelbuettel edd at debian.org
Tue Oct 1 16:59:38 CEST 2024


Denis,

This is not reproducible. You show two functions, they both take arguments,
you do not supply those. We cannot run this, so we cannot really help you.

Please try rephrasing this as a _self-contained_ example.

Now, it is always possibly that while the RNG seeds get reset properly on
'normal' C++ function brought to R via Rcpp, it may be that repeated use of
Rcpp::Function as you aim to do may 'break that contract'. You should always
be able to add the setter and getter of RNG seeds described in WRE yourself
if need.

But my advice would be to simplify to a self-contained example, and see if it
reproduces with / without extended use of R functions called from Rcpp code.

Cheers, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list