On 25 January 2011 at 12:01, Siddhartha Chib wrote: | Is it possible to pass a user defined function | written in R for use in rccparma. For example, is it possible to have a
(What is rccparma?) | function | SEXP myfunction(SEXP g, SEXP a) | where g is a function object and a is a | matrix, the argument of g? Have you looked at examples/functionCallback/newApiExample.r which installed with your copy of Rcpp -- it uses Rcpp to sweep a user-supplied R function over a vector. Doing this with a matrix is close. And just for completeness, there is more in other place; my RcppDE riff on the the DEoptim software allows you to pass objective functions as either R or C++ functions; the C++ side then needs external pointers. Hope this helps, Dirk -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel