Registered Member
|
I've been trying to efficientely set a column-major sparse matrix column to zero. Browsing for solutions in the internet I found a solution from ggael in another forum (http://stackoverflow.com/questions/20986305/set-row-column-block-to-0-in-eigen-sparse-matrix). Even though the solution works fine when setting a row to zero, using ggael words,
. In the same topic there was an unanswered question: . That is exactly what I am looking for... So, what is the most efficient way of setting a column-major sparse matrix column to zero? Any help is very much appreciated! |
Moderator
|
That depends if your matrix is in "compressed" mode or not, and if yes, whether you want to keep it in compressed mode, or turn in in non-compressed mode. In compress mode, the remaining column entries will have to be moved (costly!), whether in non-compressed mode, this can be done in constant time (the columns's entries will be kept as reserved memory for the given column.
|
Registered Member
|
I would have to understand better the pros & cons of have my matrix compressed/uncompressed to decide what I want to do. Could you please let me know when I should choose one or another, or perhaps point me to the documentation that can clarify that to me? Thanks!
Also, it would be interesting to know which type of solutions I should have in one situation and another, regardless of what I am going to do, just for the sake of education. At the end of the day, I might face both situations in the future... |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft