[Rcpp-devel] Const correctness of NumericVector iterators

Dirk Eddelbuettel edd at debian.org
Wed Nov 26 18:53:33 CET 2014


Hi Martyn,

On 26 November 2014 at 17:31, Martyn Plummer wrote:
| I got that. It is an unusual use case, but not crazy. We have a complex
| likelihood function that we want to expose to R's optimization methods
| for maximum likelihood, but we also want to drop the same code into JAGS
| for Bayesian analysis via MCMC.

Nice. That is a good setup, and I agree that Rcpp should support it.
 
| The current code uses exclusively (Rcpp)Armadillo which works
| transparently in both environments so there is now no need for any
| emulation.

Noted -- and just for the record, I tend to do exactly that for my work: use
Armadillo classes for plain C++, and RcppArmadillo around it for R.  

That gets very good and trusted and behaviour, and thanks the updated
converters from year also proper const, const &, ... behaviour at minimal
cost.  I really find that combination quite compelling.

So ... with that, do you think it is really worth mucking with
Rcpp::NumericVector to optimize const behaviour for what be an unusual use
case for Rcpp::NumericVector (which is rarely taken out of the R context) ?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list