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

2015-06-26 Thread Charles Determan
As per Dirk's suggestion about creating a trivial class, I managed to get this to work. Thank you for the suggestion Dirk, again sorry if I wasn't initially clear. class myEigen { public: myEigen(SEXP A_) : A(A_) {} MatrixXf matrix() {return as(A);} private: SEXP

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

2015-06-26 Thread Charles Determan
I apologize if I am not being clear. I realize that R doesn't have float data types, however I am able to pass a matrix in as a MatrixXf object. I would like to be able to refer to this MatrixXf object persistently. Some general code to demonstrate my point. # pass R matrix in as MatrixXf objec

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

2015-06-26 Thread Dirk Eddelbuettel
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 hav

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

2015-06-26 Thread Charles Determan
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? Many thanks, Charles On Thu, J