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

Delete a row of a sparse matrix

Tags: None
(comma "," separated)
cglwdm
Registered Member
Posts
18
Karma
0

Delete a row of a sparse matrix

Fri Mar 27, 2015 4:30 am
I am new in Eigen.

I want to delete a row and a col of a sparse matrix, what is the fastest way to do this?

Please help me, thank you!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Delete a row of a sparse matrix

Sat Mar 28, 2015 10:28 am
I guess that you probably want to remove multiple ones, in that case the best is to build a permutation (PermutationMatrix) moving the unwanted rows/columns to the end, and then use topLeftCorner or conservativeResize to pick the wanted subpart.

If by "suppress" you mean "set to zero", then the prune() method should do the job.


Bookmarks



Who is online

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