[Rcpp-devel] Short blog post on loop speed in R
Christian Gunning
xian at unm.edu
Fri Jun 24 07:19:32 CEST 2011
On Sun, Jun 19, 2011 at 11:20 AM, Douglas Bates <bates at stat.wisc.edu> wrote:
>
>
> As for the use of Rcpp, the STL containers and algorithms can be
> exploited to an even greater extent. If you are willing to jump
> through the hoops of defining a struct that inherits from
> std::binary_function then you can shorten the Rcpp-based code
> considerably.
Thanks for this, by the way. I added it to the post (which got a
shout-out from David on the Revolutions blog), along with your
comments about apply().
Strictly speaking, it's 8 vs. 6 lines of code. I guess "considerably
shorter" is in the eye of the beholder :). It's a neat template
example, in any case.
-xian
--
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!
More information about the Rcpp-devel
mailing list