[Rcpp-devel] Rcpp bug with rgamma

Colin Rundel rundel at gmail.com
Sun Oct 3 07:17:02 CEST 2010


I am working on a project using RcppArmadillo and I've run into an issue with the rgamma function in Rcpp. When calling rgamma the function pegs R's cpu utilization and the process continues to churn forcing me to kill it. I've let things run for around 5 mins with no end in sight.

I can replicate the problem with the following code:

library(Rcpp)
library(inline)

foo = "return(rgamma(1,1,1));"
cxxfunction(signature(), foo, plugin = "Rcpp" )()


Other r* functions seem to work with out issue (ie rnorm, rbeta, etc).

I am using of Rcpp 0.86 on OSX with R 2.11.1. I have not taken the time to look at the Rcpp code to see what the issue might be, but hopefully this is something that is an easy fix.

-Colin




More information about the Rcpp-devel mailing list