[Rcpp-devel] clarification of interaction between RInside and RcppEigen
Ah, that made it click. Thank you so much for the help.
On Tue, Aug 7, 2012 at 2:56 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
On 7 August 2012 at 14:43, Stephen J. Barr wrote:
| Thanks for the pointer to sugar.
|
| I was just trying to think of a simple example. So my C++ code will be
| essentially:
|
| int main() {
|
| RInside R(argc, argv); // create an embedded R instance
| R.parseEval("X = generateSomeMatrix()");
You need something like we use in the example rinside_sample1.cpp I already
pointed you too:
Rcpp::NumericVector v = R.parseEval(str); // eval string, Z then
assigned to num. vec
as you need __assign__ the result of the parseEval() to something.
This could be as generic as
SEXP mytmp = R.parseEval("X = generateSomeMatrix()");
and you can then use mytmp instantiate an RcppEigen object as you would
have
if the object had been passed down from R.
Hth, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120807/353b856e/attachment.html>