On 2012-03-22, at 5:41 AM, Glenn Lawyer wrote: > Is there a reason to prefer Rcpp::runif over the c++ rand() for, say, > accepting a state in a Markov chain simulation? Is one more random than > another? faster?
I'd use the R random generator so your C++ code is in sync with R in terms of seeds and random sequences. For instance, if you're running your simulation in parallel on multiple machines or cores, you can use one of the RNG's designed specifically to avoid correlations between individual instances, such as SPRNG or RNGstream. Davor _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
