Skip to content
Prev 5400 / 10988 Next

[Rcpp-devel] Mersenne Twister in RcppArmadillo?

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); } );

More information at:
http://arma.sourceforge.net/docs.html#imbue

Dirk is likely to release the corresponding RcppArmadillo version soon.
On Fri, Feb 15, 2013 at 7:10 AM, Simon Zehnder <szehnder at uni-bonn.de> wrote: