[Rcpp-devel] Mersenne Twister in RcppArmadillo?

Dirk Eddelbuettel edd at debian.org
Sat Mar 2 16:56:29 CET 2013


On 3 March 2013 at 01:09, Conrad S wrote:
| Hi everyone,
| 
| In Armadillo 3.800 I've added .imbue(), allowing a matrix to be filled
| using a functor or C++11 lambda expression. This allows the use of the
| Mersenne twister random number engine built into C++11.  For example:
| 
| std::mt19937 engine;
| std::uniform_real_distribution<double> distr(0.0, 1.0);
| 
| arma::mat X(4,5);
| X.imbue( [&]() { return distr(engine); } );

Nice.  I should time this / update the timing example on the Rcpp Gallery.

| More information at:
| http://arma.sourceforge.net/docs.html#imbue
| 
| Dirk is likely to release the corresponding RcppArmadillo version soon.

(He did yesterday morning; it is now on CRAN. "They" had to deliberate for 20
hours whether we would be allowed in having violated the 'no more than six
releases in six months' preference.)

Dirk 

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list