[Rcpp-devel] NumericVector Double mismatch when indexing an array

Dirk Eddelbuettel edd at debian.org
Tue Sep 25 23:45:38 CEST 2012


On 25 September 2012 at 16:19, Rodney Sparapani wrote:
| Very good.  Just one quick question since I have come across
| this in the documentation somewhere, but I can't seem to find
| it anymore.  Can you pass optimization flags like so?
| 
| f3<- cxxfunction(signature(), plugin="Rcpp", body='
|       RNGScope scope;
|       NumericVector rn = Rcpp::rnorm(5,0,1);
|       return wrap(rn);',
|       cppflags="-O2")
|       ^^^^^^^^^^^^^^
| I tried it, but it doesn't seem to make a noticeable impact on
| these benchmarks.  Is that because it is ignoring them or it
| just has no benefit?

I use and recommend ~/.R/Makevars for that --- as setting certain values at
the package level is very verboten ("non portable code" and all that) as far
as CRAN is concerned.

Now, that's the "how do you" part.  As for "does it matter" that is a
different beast as -O2 (or better) is already the default for R on my systems
(running the vanilla Ubuntu packages based on my Debian packaging).

Dirk

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


More information about the Rcpp-devel mailing list