This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Solve x A = b?

Tags: None
(comma "," separated)
tprk77
Registered Member
Posts
5
Karma
0

Solve x A = b?

Fri Feb 22, 2013 11:15 pm
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?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Solve x A = b?  Topic is solved

Sat Feb 23, 2013 8:11 am
You can transpose your problem:

x.transpose() = A.transpose().lu().solve(b.transpose());

Note that .transpose() returns an expression, so no copy/transposition overhead.
tprk77
Registered Member
Posts
5
Karma
0

Re: Solve x A = b?

Sat Feb 23, 2013 11:46 pm
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.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Solve x A = b?

Sun Feb 24, 2013 1:37 pm
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!)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]