[Rd] Accesing R c-code
Sean Davis
sdavis2 at mail.nih.gov
Thu Sep 28 20:13:56 CEST 2006
On Thursday 28 September 2006 13:36, Patricia Bautista Otero wrote:
> Hi r-devel,
>
> I am working on a R extension. My package is writen on C++ and in my code
> I require a R function object. I received the R function object, then a
> point x in which the "function" is going to be evaluated is generated in
> some way, then I evalue the "function" at x and I repete this process
> several thousand of times. Since I am using the function eval(SEXP fn,
> SEXP env) my code is really slow. Due to my major concern is speed, I
> wonder to know when it is posible to access to the parse tree of the R
> function object and build my own c++ parser tree in order to have c++
> doing the evaluations of the function instead of R, as it is now working
> in my c++ code. What I want to avoid is to have to develope a complete
> parser mainly because it would take me too much time since I am a newe in
> compilers and parsers.
>
> It would also help me to know how R mcmc packages work, because it is more
> or less the same situation. In mcmc packages a target density function is
> required, and I suppose this density function is evaluated many many
> times, but this packages are not too slow.
If you want to look at a package, you can just download the source and look at
it. The source for most packages is available on CRAN.
Sean
More information about the R-devel
mailing list