Skip to content

Coding C++ in R. What is faster : Using bosst external libraries or R.h header file?

3 messages · Ian Schiller, R. Michael Weylandt

#
There will be ever-so-slight performance differences due to
implementation differences (I believe R's functions are just a hair
slower because they are more exact -- though that may be a comparison
with GSL I'm thinking of), but my advice would be to use the RNGs that
come with R. They are the best in the business and you'll have the
benefit of them being auto-upgraded with each new R release (as well
as getting better support from the R lists).

What you really should look into is the Rcpp project. It provides nice
wrappers to R's RNG functions and makes the whole porting process
worlds easier: e.g., http://dirk.eddelbuettel.com/blog/2011/07/14/

Hope this helps,

Michael

On Tue, Mar 13, 2012 at 9:33 AM, Ian Schiller
<Ian.Schiller at clinepi.mcgill.ca> wrote:
#
Thank you Michael,

Your advices are truly appreciated!

Ian

-----Original Message-----
From: R. Michael Weylandt [mailto:michael.weylandt at gmail.com] 
Sent: 13 mars 2012 09:44
To: Ian Schiller
Cc: r-help at r-project.org
Subject: Re: [R] Coding C++ in R. What is faster : Using bosst external libraries or R.h header file?

There will be ever-so-slight performance differences due to implementation differences (I believe R's functions are just a hair slower because they are more exact -- though that may be a comparison with GSL I'm thinking of), but my advice would be to use the RNGs that come with R. They are the best in the business and you'll have the benefit of them being auto-upgraded with each new R release (as well as getting better support from the R lists).

What you really should look into is the Rcpp project. It provides nice wrappers to R's RNG functions and makes the whole porting process worlds easier: e.g., http://dirk.eddelbuettel.com/blog/2011/07/14/

Hope this helps,

Michael
On Tue, Mar 13, 2012 at 9:33 AM, Ian Schiller <Ian.Schiller at clinepi.mcgill.ca> wrote: