Print Story i can't stop partyin', partyin'
Working life
By gzt (Tue Mar 06, 2018 at 12:02:55 AM EST) gzt, got to get out of here (all tags)
I've been fiddling around the last week Rcpp and RcppArmadillo, interfaces that make it easy to drop into C++ and use the Armadillo C++ library in R...


...and they're really quite nice.

So I work in either C or R depending on how intense the need for computation vs the need for being able to actually work with your objects is, but never really tried to interface the two. About two weeks ago, however, I decided to give it the C/R interface a whirl as I was working on a package to do some sampling and a function I wanted was just a slight modification of existing C code that interfaced with R. So I tried doing that and it worked, but it was horribly, horribly painful. I barely survived. Anyway, then I spun that package off and put it on CRAN (the big repository of R packages that is guarded by cranky-pants troglodytes), because I wanted to also see how that process was and I felt that I might as well have something to show for my battles with C. After all, if I wanted this thing done quickly, somebody else might as well. So, I now have a package with a lot of C in it on CRAN.

Anyway, so last week one of my colleagues presented a quick intro to Rcpp so I started giving that a whirl for another part of a package I'm developing that I spun the C nonsense off of. It is remarkably less painful, though I don't know C++ at all. I program C++ like a C programmer, but that's fine for getting some brute efficiency going. I'm sure if I actually took advantage of templates and vectorization and all that shiny C++ stuff they have lying around it'd be even better, but since I program R like a C programmer (and C like and R coder), this just makes everything fly.   They really do make things easy. I had one simple thing that sped up 30x from a naive R implementation.

Other stuff: my grandfather (the last of my grandparents) turned 90 this weekend. His own father lived to 87.

More: I've got to finish up my work. I'm behind. I've got to get out of here by the summer regardless.

< I'm a complete banker | First group ride of the season was yesterday >
i can't stop partyin', partyin' | 0 comments (0 topical, 0 hidden) | Trackback