Registered Member
|
I am attempting to compute a change of coordinates for a symmetric matrix. I have a real, symmetric, positive semi-definite matrix A that has dimensions (n,n), and another real matrix J (a jacobian matrix) that has dimensions (m,n). I would like to compute the (m,m) symmetric matrix B = J * A * J.transpose(), and I am happy to use single precision. This matrix product is currently a bottleneck in my computation.
Is there anything I can do to speed up the product in eigen3 over the naive implementation (J*A)*J.transpose()? In particular can I exploit that B is symmetric to reduce the number of elements calculated? Thank you, John |
Moderator
|
that depends a lot on the actual sizes of the matrices? If they are large enough, you will find solutions in this forum, basically something like:
B.triangularView<Lower>().noalias() = J * (A.selfAdjointView<Lower>() * J.transpose()); |
Registered Member
|
Thank you. For a typical problem, the matrix J is (20, 100) and A is (100, 100), and neither size is fixed at compile time. I will try the triangularView technique.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]