[Rcpp-devel] Passing XPtr of Eigen Map object between functions

Dirk Eddelbuettel edd at debian.org
Fri Jun 26 15:32:51 CEST 2015


On 26 June 2015 at 07:43, Charles Determan wrote:
| I have tried a few more feeble attempts (explicitly create pointer to pass,
| passing just the MatrixXf object) at getting the Eigen object to persist
| between functions without the additional Armadillo wrapper but with no
| success.  Anyone have any additional thoughts?

You are not making it very easy to help you as you do not clearly say what
you really want.  Some things you talk about don't exist (ie "float matrix in
R"), others make no sense (XPtr of Eigen::Map when the latter already is a
proxy object).

As for the question of persistence, the single simplest approach I often use
it create a trivial class holding a member variable of the "thing" you want
to persist (often a database or resource handle, could even be a honking
bigmemory object and shared handle) whichI create in the constructor, or an
init() function, and release in the destructor.

Dirk

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


More information about the Rcpp-devel mailing list