Re: [Rcpp-devel] template functions with Rcpp

2015-05-02 Thread daniel castro
Thank you Kevin, I'll try another approach but only knowing that I can't do it that way is useful for me. Regards Daniel El 02/05/2015 07:40, "Kevin Ushey" escribió: > Hi Daniel, > > Unfortunately, you cannot use // [[Rcpp::export]] to automagically export > template functions. > > The general a

Re: [Rcpp-devel] template functions with Rcpp

2015-05-01 Thread Kevin Ushey
Hi Daniel, Unfortunately, you cannot use // [[Rcpp::export]] to automagically export template functions. The general alternative approach is to define a template implementation, and then dynamically dispatch to that implementation, e.g. template void doStuffImpl() { ... } with dispatch a

[Rcpp-devel] template functions with Rcpp

2015-05-01 Thread daniel castro
Hello, I'm trying to build a function that calculates (for example) the log of all elements of a container. I want this container to be a vector, a Rcpp::numericVector , or perhaps a arama::colvec , so I'm trying with templates ,and it compiles without the // [[Rcpp::export]] part, but when I put