From: Zuofeng on
Hi Tim,

I have a question about the inverse of a large dimensional square matrix.
I have a matrix of 2048 x 2048, and I need to invert it in each of 5000 iterations,
which is time consuming.

Basically, I need to calculate A * inv(B)* A' in each loop. B is a large matrix.
Is there any fast way to do this? Please forgive me if this question is kind of stupid
and accept my best thanks!

Jeff
From: Zuofeng on
Hi Tim,

I have a question about the inverse of a large dimensional square matrix.
I have a matrix of 2048 x 2048, and I need to invert it in each of 5000 iterations,
which is time consuming.

Basically, I need to calculate A * inv(B)* A' in each loop. B is a large matrix.
Is there any fast way to do this? Please forgive me if this question is kind of stupid
and accept my best thanks!

Jeff
From: John D'Errico on
"Zuofeng " <shang(a)stat.wisc.edu> wrote in message <hh1cjp$n8e$1(a)fred.mathworks.com>...
> Hi Tim,
>
> I have a question about the inverse of a large dimensional square matrix.
> I have a matrix of 2048 x 2048, and I need to invert it in each of 5000 iterations,
> which is time consuming.
>
> Basically, I need to calculate A * inv(B)* A' in each loop. B is a large matrix.
> Is there any fast way to do this? Please forgive me if this question is kind of stupid
> and accept my best thanks!
>
> Jeff

Do you have a fixed matrix B that you are repeatedly
trying to invert here? If so, then don't invert it.
Instead, factorize it. (You can use Tim's factorize
utility from the file exchange to do so.)

http://www.mathworks.com/matlabcentral/fileexchange/24119

Store the matrix factorization, then just re-use it
repeatedly.

If B is changing inside the loop, then you can still
use a form like

A*(B\A')

instead of using inv.

John