This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen MatrixXd and R

Tags: None
(comma "," separated)
bkot
Registered Member
Posts
11
Karma
0

Eigen MatrixXd and R

Wed Apr 11, 2012 10:25 pm
This might be a bit off-topic... I have C++ code that uses Eigen dynamic matrices. Would someone have a small and simple example of using R functions on MatrixXd data? I found Rinside package (http://dirk.eddelbuettel.com/code/rinside.html), but it would be great to be able to use it without having to make a copy of Eigen matrices into NumericMatrix in R.

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen MatrixXd and R

Thu Apr 12, 2012 7:40 am
You can use .data() to get a pointer to the first element of the matrix, and .outerStride() to get the leading dimension. Then how to make use of them with R is out of my knowledge. You should ask on a R forum.
vak
Registered Member
Posts
23
Karma
0
OS

Re: Eigen MatrixXd and R

Thu Apr 12, 2012 10:37 am
have you looked at the sources of the Rclusterpp package? I'm not sure but it seems to me it is calling some R functions
http://cran.r-project.org/web/packages/ ... index.html

For the moment, there are only two R packages using eigen
(the other one is sparseLTSEigen).
bkot
Registered Member
Posts
11
Karma
0

Re: Eigen MatrixXd and R

Thu Apr 12, 2012 9:53 pm
Thanks.

I was also pointed to RcppEigen package on the Rcpp mailing list.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]