![]() Registered Member ![]()
|
Hi,
I have an algorithm where I need to extract the 3x3 blocks on the diagonal of a square row-major sparse matrix with a size that's a multiple of 3, and then copy each of them into its own dense matrix. The problem is, I have no idea how exactly to do that. Looking at the available methods for sparse matrices, there doesn't seem to be any to directly access a sub-block in a sparse matrix (for performance reasons I assume). And I'm not sure if there's any way to efficiently do this using other methods. One thing, though, is that the matrix is declared as self-adjoint. From what I understand, if I also add UpperTriangular, then only the upper triangular part is stored, with any operators taking this into account if the lower triangular part is accessed, right? Then would it be possible for me to access the raw storage, where I'd be guaranteed that the first entry of any compressed row is on the diagonal, and then extract the values I need for my 3x3 block? I'd prefer to use the higher-level methods if this can be done efficiently with them, but if not what would be the easiest way to gain access to the raw storage? I apologize if this has been asked before or if I missed something obvious, I looked around on the forums and in the documentation and I'm still not sure how to go about this. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]