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

can I add or remove some column or row from a matrix?

Tags: None
(comma "," separated)
silent_missile
Registered Member
Posts
7
Karma
0
OS
Helllo

When I use eigen for computing, some times I need to add or remove some columns or rows from a matrix. For example, I have a 4*5 matrix, and I need to remove row 3, then the matrix would become 3*5.

I took a look at the tutorial, but I couldn't find the function to do it.

Can anybody tell me how to operate?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
there is no convenient function to do so. If you want to remove the last rows and/or columns you can use A.conservativeResize(rows, cols); Otherwise you can copy the rows/columns you want to keep on top of the ones you want to delete, and then call conservativeResize().
stephanel
Registered Member
Posts
2
Karma
0
With the latest version of Eigen (3.3.5), is there now an elegant way to do that?


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell