[Rcpp-devel] Conversion of Rcpp::Vector Rcpp::List and Rcpp::Matrix to std objects - OpenMP

Davor Cubranic cubranic at stat.ubc.ca
Tue Jun 18 17:48:20 CEST 2013

On 13-06-02 08:09 AM, Simon Zehnder wrote:
> My comments:
> 1) Set always '++i' not 'i++'. The second directive involves a copy,
> whereas the first one doesn't. This makes the first one faster.

Really? When just incrementing the for-loop index counter? Any current 
compiler will do the efficient thing here. Have a look at the assembly 
output ("-S" option for gcc) and compare the version using pre- and 
post-decrement of "i".


More information about the Rcpp-devel mailing list