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

How to transform Matrix class into a regular C array?

Tags: None
(comma "," separated)
lqiang67
Registered Member
Posts
1
Karma
0
OS
Hi,

I need to take a matrix as an output into MATLAB(I am writing a mex file). Does anyone know how to do it? I was trying to transform the matrix class into a regular C array so that I can output it, but can not figure out how to do it....

Thank you very much!
lvdong
Registered Member
Posts
5
Karma
0
Eigen matrix is stored continuously, the storage order is row-major or column-major, so you can directly use the pointer, &m(0,0)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
there is also the .data() method to get the address of the first entry.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]