[Rcpp-devel] Pointer troubles
On Wed, Aug 3, 2011 at 10:22 AM,
<rcpp-devel-request at r-forge.wu-wien.ac.at> wrote:
Simple examples are in a demo file in the package, see demo(CompiledBenchmark) -- or more importantly, see its source and the RcppDE source.
I'm now cobbling together a small XPtr section in Rcpp-quickref based on these 2 related threads, which have been enormously helpful to me. Thanks, I think I finally get it. In the meantime, for the inveterately lazy and/or confused, here's the horse's mouth, with some key lines therein to trace up from: https://r-forge.r-project.org/scm/viewvc.php/pkg/RcppDE/demo/CompiledBenchmark.R?view=markup&root=rcpp create_xptr <- cxxfunction(signature(funname="character"), body=src.xptr, inc=inc, plugin="Rcpp") ## ... cppDE <- function(n, maxIt, fun) RcppDE::DEoptim(fn=fun, lower=rep(-25, n), upper=rep(25, n), control=list(NP=10*n, itermax=maxIt, trace=FALSE))#, bs=TRUE)) ## ... xptr <- create_xptr(funname) ct <- system.time(invisible(cppDE(n, maxIt, xptr)))[3] -Christian
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal ? Panama!