[Rcpp-devel] Mersenne Twister in RcppArmadillo?

Simon Zehnder szehnder at uni-bonn.de
Sun Mar 3 11:52:53 CET 2013


Hi Dirk,

I recognized the function rnorm in Rcpp. But as I work most times with RcppArmadillo and Armadillo objects I wanted to avoid constructing NumericMatrix objects, fill them and convert them to arma::mat objects. Instead I decided to immediately generate arma::mat objects and fill them - which was impossible without a loop when using a controlled random number generation (for instance with the possibility to set the seed).

I would like to ask something connected to the new feature:
The C++ standard library (random) uses specific functions for random number generation (for example std::gamma_distribution) , that are only available when using a compiler supporting the C++11 standard. As far as I know R uses C++99. So in a package these functions would be useless when redistribution should be made possible. Do you know about some comments by the R core team regarding the C++11 standard? Does it come soon?

Best Simon 

 


On Mar 2, 2013, at 11:09 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> 
> On 2 March 2013 at 22:40, Simon Zehnder wrote:
> | That was fast Dirk! I will update my packages on Monday! Thank you for that quick release! 
> 
> Well I have been releasing within 24 hours of Conrad all along for what must
> now be two dozen releases ... so my release wasn't exactly news.
> 
> As for your other point, you also had
> 
>   NumericMatrix = rnorm(n, k);
> 
> for a long time, so there was no need to loop when you used Rcpp.
> 
> Dirk
> 
> -- 
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  



More information about the Rcpp-devel mailing list