[Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo
edd at debian.org
Fri Sep 26 13:57:08 CEST 2014
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:
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.
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel