On Sun, Feb 10, 2013 at 12:32 AM, Yan Zhou <zhou...@me.com> wrote: > To have Armadillo randn use MT19937 is not easy. > Since it use srand() for seed, I guess it also use C rand(), > whose quality is quite questionable.
The quality of the rand() function from C depends on the implementation in libc, which varies from system to system. While I'd like to incorporate a Mersenne-Twister random number generator directly in Armadillo, it would either add a dependency on Boost, or on C++11. Boost might not be available on a user's system, and the degree of support for C++11 features varies from compiler to compiler. We also have to bear in mind that R folks currently disallow CRAN packages that use C++11. As a possible interim solution, I'll look into extending the .fill() function to accept a functor, so that a matrix could be filled with random numbers with the aid of a user-defined class, without explicitly declaring a loop. _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel