The idea of the package is to pass STL functions as arguments like we normally do in R, and have it feel as similar as possible. This might be a good opportunity to cite the original paper on the R language.
Rcpp: why/when we’re motivated to use it and write tools for it. When can R be slow and why use R versus C++?
What is the use case? In many situations, we carry out tasks like integration and optimization in R and write the integrand or target function in C++ if their computation is slow or cumbersome in R. Rcpp is used to generate an R interface for the C++ function so that they can be integrated. A use case for the present work is when we are in Rcpp already, perhaps as part of a larger computation, and need to do an integration. Calling back to R is possible, but incurs a performance penalty. Doing so repeatedly accumulates the penalty, and may negate performance benefits of using C++ in the first place.
Comments
I think a nice document will make a huge difference in the usability of this package. The generated documentation from Doxygen is okay, but not the most appealing. It has a lot of cruft that distracts from what I’d want to see as a user.
Here’s what I have in mind right now. Let’s try to manually document the API in a human readable way.
TBD:
fd_hessian
use the Numerical Cookbook version offd_deriv
?[[Rcpp::plugins("cpp11")]]
somewhere too.