On 19 June 2011 at 13:20, Douglas Bates wrote: | Interesting post, Christian. It turns out that the apply family can | get better performance than the explicit loop but, as you have seen, | no using aaply. The choices in this case are sapply or, slightly | faster, vapply from the base package. I also tried using cmpfun from | the compiler package but vapply is already very tight so compiling | that call doesn't change the timing. | | 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. See the enclosed.
Now we're talking! Very nice post by Christian, and and a very impressive follow-up by Doug. Keep it coming, guys Dirk -- Gauss once played himself in a zero-sum game and won $50. -- #11 at http://www.gaussfacts.com _______________________________________________ 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