Registered Member
|
Hi,
I have an Eigen matrix (say MatrixXd A) with the following structure A = [A1;0;A2;0;A3], where A1, A2 and A3 are blocks (of rows) separated by blocks of zeros. If there are no zero blocks in between the "meaningful" entries of A, A happens to be upper triangular, so I could directly use e.g.,
where B and X are matrices with appropriate dimensions. What would be a reasonable/efficient approach for handling the case when there are blocks of zeros separating the data, and noting that even if there are zero blocks (of rows) in A, the matrix B has the same dimensions as before? Before implementing a dedicated routine myself, I was wondering whether there are "tricks" in Eigen that could be used to accomplish this (e.g., by using Map and then the builtin triangular solvers). As an example consider the matrix A below
Note that the row size of A1, A2, A3 as well as the row size of the zero blocks could be arbitrary. Thanks |
Moderator
|
You can either fill a SparseMatrix and let Eigen does the job scalar-wise (http://eigen.tuxfamily.org/dox-devel/gr ... parse.html) or exploit the blocking structure yourself by write your own solver on top of Eigen's triangular solves and products (using .block(...) or Map<>).
|
Registered Member
|
Most probably the second option would be better.
Thanks. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]