[Rcpp-devel] No matching function for calls to Rmath.h

Davor Cubranic cubranic at stat.ubc.ca
Thu Sep 16 22:00:58 CEST 2010

On 2010-09-15, at 4:30 PM, Dirk Eddelbuettel wrote:

> It's a feature :)   
> First, the fix -- use ::Rf_dpois to access R's scalar variant directly:

Thanks, that indeed solved the problem.

> The NEWS file etc would have lead you there, but then we tend to change so
> many things that it is easy to overlook items :)

I did read the announcement, but completely missed the significance of:

>    o   new sugar functions for statistical distributions (d-p-q-r functions)
> 	with distributions : unif, norm, gamma, chisq, lnorm, weibull, logis,
> 	f, pois, binom, t, beta.

I should have added that in my original code, I ran into this error while I was in RcppArmadillo-land, so the new functions on NumericVectors did not really cross my mind.

I knew there were 'Rf_'-prefixed flavours of each of these functions in Rmath.h, but thought they were the same. (I remember seeing '#define dpois Rf_dpois', or something like that.) Are 'Rf_' names the recommended ones? 

Can we have 'Rcpp::dpois(double, double, int)', or even not shadow the 'dpois' in the global namespace at all? I already changed my code to use '::Rf_dpois', so I'm mostly just curious from the technical standpoint. I *had* thought of trying '::dpois' before emailing this list, but that did not help at all and it feels like it would be a good thing (as a C++ programmer) to understand why it did not.


More information about the Rcpp-devel mailing list