[Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

Christian Gunning xian at unm.edu
Wed Nov 14 14:05:48 CET 2012


Dear all,

The attached file is for inclusion in RcppArmadillo/src.  It's a templated
implementation of R's sample that relies on a few Armadillo functions.  It
should produce results identical to R, except when R uses Walker's alias
method (with replacement, more than 200 nonzero probabilities given).

This is intended to be used solely in C++ code, and is not exported.

best,
Christian
University of New Mexico

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121114/2b4a422b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.cpp
Type: text/x-c++src
Size: 5664 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121114/2b4a422b/attachment.cpp>


More information about the Rcpp-devel mailing list