Registered Member
|
I have some matrices in Eigen data types format and I want to use them in a GNU Scientific Linrary routines.
Specifically I want to use the routines for 15.6 Real Generalized Nonsymmetric Eigensystems that are here: http://www.gnu.org/software/gsl/manual/ ... stems.html I would appreciate any advice on how to feed GSL routines with Eigen matrixes. Thank you |
Registered Member
|
Eigen matrices are stored contiguously, without any padding/stride or anything complicated. Column-major by default, but you can change that. So it should be trivial to pass them to GSL routines. To get a pointer to the array of coefficients of a matrix, call .data()
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Thank you very much.GSL uses row major when storing arrays in the memory?
|
Registered Member
|
No idea, look at their documentation. If you want row-major with Eigen, do for example: Matrix<float,Dynamic,Dynamic,RowMajor>
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Thanks. I ll post when I find any convenient tip on using GSL with Eigen
|
Registered Member
|
Well I think it's rather simple...
We declare the matrix with RowMajor mode Eigen::Matrix<double,30,30,Eigen::RowMajor> A; and we declare the GSL matrix: gsl_matrix_view Agsl = gsl_matrix_view_array (A.data(), 30, 30); I tested it and hope that's it! |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]