On 14 May 2011 at 16:33, Douglas Bates wrote: | You can check what is done in R itself in the R sources but I imagine that it | uses a uniform random variate converted to an integer through the cumulative | probabilities. The good news is that it is easy to create the cumulative | weights with the std::accumulate function.
Good point. I just looked at src/main/random.c in the R sources, and the main worker functions are once again defined as hidden. Sigh. May make sense to 'port' this as helper functions for Rcpp::IntegerVector. Dirk -- Gauss once played himself in a zero-sum game and won $50. -- #11 at http://www.gaussfacts.com _______________________________________________ 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