[R] Converting Fortran or C++ etc to R
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Wed Jan 5 12:32:26 CET 2011
On Wed, Jan 5, 2011 at 7:33 AM, lcn <lcn918 at gmail.com> wrote:
> As for your actual requirement to do the "convertion", I guess there'd not
> exist any quick ways. You have to be both familiar with R and the other
> language to make the rewrite work.
To make the rewrite work _well_ is the bigger problem! The easiest
way to big performance wins is going to be spotting vectorisation
possibilities in the Fortran code. Any time you see a DO K=1,N loop
then look to see if its just a single vector operation in R.
Another way to big wins is to write test code, so you can check if
your R code gives the same results as the Fortran (C/C++) code at
every stage of the rewrite. Don't just write it all in one go and then
hope it works! Small steps....
Barry
More information about the R-help
mailing list