Registered Member
|
Hi there everyone.
I know that one cannot yet fill a sparse matrix through direct block insertion. So, I'm thinking that there must be some way to get the intendend block elements values and respective indices, associate them with a triplets list and them finally inserting them into a sparse matrix. Does anyone know a efficient way to do this, or any other kind of fast operations that allow the creation of a sparse matrix given a set of sparse submatrices? Maybe iterating thorugh the sparse matrix like the below code, and then creating a triplet list is the most efficient currently available set of operations?
Thank you. Best regards, André |
Moderator
|
Indeed, currently users have to do their own cooking for that kind of operations. Filling a big triplet list is definitely the easiest and safest way.
|
Registered Member
|
In fact, this kind of "user-made" solution has got me thinking more closely to thie actual problem and I was actually able to significantly reduce the needed computational time, with comparison to a previous solution that I had implemented with a different linear algebra library. Just to clarify one more aspect, I'll be needing this kind of sparse matrix filling scheme for a given number of iterations. So, between each of the iterations, I'll have to "clean" a given number of sparse matrices, which were created from triplets (batch insertion). Any advice about the fastest and safest way to clear a sparse matrix in eigen? SparseMatrix.setZero()? Thank you, André |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]