Registered Member
|
Hi,
we implemented a UDU^T decomposition AddOn for MatrixBase with U as upper unit triangular matrix and D as diagonal matrix. The result is saved in the upper triangular part and the diagonal of the same matrix. When I want to do the recomposition:
I get a compiler error: error: no match for ‘operator*’ ... What I can do is:
But in this way I would loose the optimization I could get with the knowledge of M2 beeing diagonal (and I would have to create a temporal...). Is there another way? Cheers Korbi |
Moderator
|
it seems your decomposition is just a variant of the LDLT we have in the Cholesky mode but without pivoting.
To reconstruct the original matrix you can do: M_ud = M_ud.triangularView<UnitUpper>(); M_ud = (M_ud * M_ud.diagonal().asDiagonal()) * M_ud.triangularView<UnitUpper>().transpose(); Yes that's not optimal but still better than converting the diagonal into a full matrix. |
Registered Member
|
Thank you ggael for the idea. It's apparently the best solution without modifying eigen.
You are right, the UDU^T is just a modified Cholesky decomposition that is used for square root filters (without square roots Would it make sense to add a mult operator to the triangular wrapper to multiply with diagonal matrices and one to diagonal matrices the other way around. Is this an already requested feature? Cheers Korbi |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]