On Thu, Nov 15, 2012 at 8:11 AM, Romain Francois
<rom...@r-enthusiasts.com> wrote:
> I'm not getting the same results, so I might not make the same conclusions:
>
>
> Unit: microseconds
>       expr    min     lq  median      uq    max
> 1   sum(x) 16.072 16.161 16.2090 16.3110 21.721
> 2  sum1(x) 10.771 10.954 11.0445 11.1910 16.163
> 3  sum2(x) 48.438 48.567 48.6650 48.8425 61.116
> 4 sum2a(x) 10.806 10.965 11.0695 11.2080 17.401
> 5  sum3(x) 10.835 10.967 11.0490 11.1875 23.943
> 6  sum4(x) 10.847 10.989 11.0690 11.2160 16.331
>
> For me that makes more sense.

I just discovered the problem with my accumulate.  I was doing:

double total = std::accumulate(x.begin(), x.end(), 0);

instead of

double total = std::accumulate(x.begin(), x.end(), 0.0);

Hadley

-- 
RStudio / Rice University
http://had.co.nz/
_______________________________________________
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

Reply via email to