필터 지우기
필터 지우기

Avoiding inverse of a matrix

조회 수: 10 (최근 30일)
N Madani SYED
N Madani SYED 2012년 7월 27일
Hi all,
I need to compute the following (RHS matrices known):
Z bb = M bb - ( M bi * inv( M ii ) * M ib )
where bold letters denote large (of the order 5000 or more) sparse complex matrices;
italic letters denote size of matrices.
I need to perform this operation many a times (say 2000 or so).
Now, for a matrix of size 4000x4000; the above calculation needs approximately 90 s. If I have to repeat this calculation for 2000 times, it would need 50 hours!!
Is there any way to avoid finding the inverse of the matrix in above calculation (since inv function takes the most time) and speed up the computational time (hopefully exponentially).
Regards
N Madani SYED

답변 (2개)

Mike Hosea
Mike Hosea 2012년 7월 27일
We usually write A\B instead of inv(A)*B. So if you're computing D - C*inv(A)*B, then write it D - C*(A\B). It's hard to predict exactly how much that will help, but give it a try.

Bjorn Gustavsson
Bjorn Gustavsson 2012년 7월 27일
Well if it is just one and the same matrix you're using for every case it must be better to "invert" it once - then the equation becomes a simple sequence of matrix multiplications. I write "invert" inside auotation marks because there might be better ways than straightforward matrix inverstion. Have a look at this file exchange submission:
HTH Bjeorn

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by