Registered Member
|
Hi,
Is there a way to resize a sparse matrix while preserving its values? I think that similar to .setFromTriplets(), there should be a method .saveToTriplets() that would assist in copying from one matrix to another. |
Moderator
|
Indeed, there should be a conservativeResize. Fell free to add a bug report (http://eigen.tuxfamily.org/bz) so that we don't forget, or even better you could try to come up with a patch
|
Registered Member
|
Actually, there is already a patch there: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=449 .
Gaël, to me it looks pretty good, but I did not look at it in detail because I don't know much about sparse matrices in Eigen. Zoharl, perhaps you can try the patch, see whether it does what you wants, and let us know. |
Registered Member
|
I'm not familiar with the library architecture to confirm if the patch cover all the cases.
I do think though that creating a new matrix through triplets for example should be safe enough. |
Moderator
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]