Registered Member
|
This is probably a dumb question... here goes. Eigen can solve A x = b, is there also an easy way to solve x A = b?
Really, I'm trying to calculate the gain for a Kalman filter, which is typically written as K = P H (H P H^T + R) ^-1. I'm trying to avoid doing a matrix inverse by solving for the kalman gain, K. Any suggestions? |
Moderator
|
You can transpose your problem:
x.transpose() = A.transpose().lu().solve(b.transpose()); Note that .transpose() returns an expression, so no copy/transposition overhead. |
Registered Member
|
This is just what I was looking for. I forgot (A B)^T = B^T A^T, thanks!
Also, it's good to know there is no copy/transposition overhead. Eigen is very useful. |
Moderator
|
Just for the record, in the future we plan to support a more natural syntax like:
x = b * A.lu().inverse(); (that will trigger a call to solve, no explicit inverse computation!) |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]