Re: [Rcpp-devel] "expecting a string" and not finding it in a CharacterVector

2013-02-09 Thread Davor Cubranic
On 13-02-09 05:06 AM, Dirk Eddelbuettel wrote: On 8 February 2013 at 20:58, Davor Cubranic wrote: That fixed just the runtime fault in "as", right? Or did it somehow also take care of ctor for const string from an element of const CharacterVector? > Variants with 'const CharacterVector' still

Re: [Rcpp-devel] RCMake

2013-02-09 Thread Dirk Eddelbuettel
Hi Wush, On 10 February 2013 at 01:28, Wush Wu wrote: | I'm looking for a setup / combination of tools / IDE which provides a | convenient developing environment of C/C++ extension of R. To the best | of my knowledge, there is no complete solution so far. | | I have built a R package for generat

[Rcpp-devel] RCMake

2013-02-09 Thread Wush Wu
Dear developers, I'm looking for a setup / combination of tools / IDE which provides a convenient developing environment of C/C++ extension of R. To the best of my knowledge, there is no complete solution so far. I have built a R package for generating CMake script of R and Rcpp projects. The pac

Re: [Rcpp-devel] Mersenne Twister in RcppArmadillo?

2013-02-09 Thread Yan Zhou
This really is a BIG topic and worth a few more comments. Note that I wrote a few related posts on RNGs at the Rcpp Gallery, see for example http://gallery.rcpp.org/articles/timing-normal-rngs/ which compares the RNGs from R, C++11 and Boost. Simon just added Armadillo to the list, we can add ev

Re: [Rcpp-devel] Mersenne Twister in RcppArmadillo?

2013-02-09 Thread Dirk Eddelbuettel
On 9 February 2013 at 14:32, Yan Zhou wrote: | You have at least two choices. | | 1. Just use std::mt19937 as you do in other C++ code. | std::mt19937 eng; | std::normal_distribuiton rnorm(0, 10); // or any other dist you need | arma::vec v(N); | for (int i = 0; i != N; ++i) | v[i] = rnorm(

Re: [Rcpp-devel] Mersenne Twister in RcppArmadillo?

2013-02-09 Thread Yan Zhou
You have at least two choices. 1. Just use std::mt19937 as you do in other C++ code. std::mt19937 eng; std::normal_distribuiton rnorm(0, 10); // or any other dist you need arma::vec v(N); for (int i = 0; i != N; ++i) v[i] = rnorm(eng); 2. Rcpp has convenient way to use R runtime's RNG, wh

[Rcpp-devel] Mersenne Twister in RcppArmadillo?

2013-02-09 Thread Simon Zehnder
Dear Rcpp-Devels, I am right now working on a simulation where I use the 'randn()' function of Armadillo. I know, that the seed can be controlled via std::srand(). What I would like to know is: What kind of Generator is used by Armadillo? Can I in some way use the std::mt19937 or std::mt19937_6

Re: [Rcpp-devel] "expecting a string" and not finding it in a CharacterVector

2013-02-09 Thread Dirk Eddelbuettel
On 8 February 2013 at 20:58, Davor Cubranic wrote: | That fixed just the runtime fault in "as", right? Or did it somehow also take care of ctor for const string from an element of const CharacterVector? The former: R> sourceCpp("/tmp/davor.cpp") R> cv <- c("The", "quick", "brown", "fox") R> get