Christian, On 26 September 2014 at 04:41, Christian Gunning wrote: | The Walker Alias method is now (finally) implemented, along with unit | tests. To my knowledge, the only thing not implemented is R's sample2 | - a special version of sample.int for (!replace && is.null(prob) && n | > 1e+07 && size <= n/2). | | I also added rmultinom, which behaves how an R API C function call | might, providing a single draw. E.g., in R, rmultinom(1, size, prob). | It's the user's responsibility to normalize probabilities with the | provided function Fixup, which I moved from sample.h to a separate | file, fixup.h. | rmultinom does throw a range_error in probs don't sum to ~1. | | Pull request is here: | https://github.com/RcppCore/RcppArmadillo/pull/22
Sweet, thanks -- now merged. Minor request: Try to also add a ChangeLog entry. In the One True Editor that is trivial as you just type 'C-x 4 a' in the file to be documented ... And added bonus points for an NEWS.Rd entry. I now added both. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _______________________________________________ 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