[Rcpp-devel] exposing a C++ function to RInside

Stephen J. Barr stephenjbarr at gmail.com
Sat Aug 18 23:08:15 CEST 2012


I have a quick design question. I am working on a program that uses RInside
and RcppEigen, and I want to expose a function back to R. Specifically, I
have a C++ function with the following signature:

double nll_singleton(
     const VectorXd& theta,
     const MatrixXd& ua,
     const MatrixXd& ub,
     const MatrixXd& Xmat,
     const MatrixXd& Ymat);

I would like to run R's optim over this function, where 'theta' is the
vector that I am optimizing over. Would I use RCpp::InternalFunction for
this? nll_singleton is going to call MPI and I would rather do it this way
than use mpi over R, if this is possible.

Thank you and best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120818/a9a2f6e5/attachment.html>

More information about the Rcpp-devel mailing list