At Sun, 15 Apr 2012 19:01:30 +0100, Marie Auger-Methe wrote: > I want to use a random generator that is not available in the Rcpp: > rvm from R's CircStats package and I want the number generated to be > the same as the equivalent function in R. Importing the function > within a Rcpp inline function works fine except if you have an > if-else statement. The strange thing is that it works as long at the > if-statement is TRUE, and then it doens't work anymore and some > numbers are repeated but not in the same order.
In this example, it looks to me that the key is that as soon as you start using 'vmc', the numbers get out of order. If that's the case, then perhaps 'vmc' and 'runif' somehow both use the random seed, but RNGScope keeps track only of 'runif's? Davor _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel