Dear all,
By "accident" I noticed that indexing with x(i) and x[i] gives remarkable
difference in computing time. For example:
library(Rcpp)
cppFunction('
IntegerVector insert1 (int n){
IntegerVector z(n);
for (int i=0; ihttps://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
> Le 27 nov. 2014 à 13:22, Søren Højsgaard a écrit :
>
> Dear all,
> By "accident" I noticed that indexing with x(i) and x[i] gives remarkable
> difference in computing time. For example:
>
> library(Rcpp)
> cppFunction('
> IntegerVector insert1 (int n){
> IntegerVector z(n);
> for (int i=0;