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. On May 14, 2011 4:12 PM, "Chris DuBois" <chris.dub...@gmail.com> wrote:
_______________________________________________ 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