Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
psychologically triangular matrix

Subject: psychologically triangular matrix

From: Petr Krysl

Date: 7 Nov, 2008 01:01:05

Message: 1 of 2

I understand that lu can return a psychologically triangular matrix when called with two output arguments. The question is, what does Matlab to to use the psychologically lower triangular matrix efficiently?

In other words, let's say I do
[L,U] =lu(A);
to efficiently solve for many different right-hand sides b
x=U\(L\b)

How efficient is this going to be with L not being strictly lower triangular? Does Matlab somehow recognize that the matrix is psychologically lower triangular, and make note of it someplace for future use?

I know that one could also collect the permutation matrix from Matlab. My question is to the reasoning behind returning just two matrices, with L being possibly not a nice triangular matrix.

Thanks,

Petr

Subject: psychologically triangular matrix

From: Tim Davis

Date: 7 Nov, 2008 02:51:01

Message: 2 of 2

"Petr Krysl" <pkryslNOSP@Mucsd.edu> wrote in message <gf040h$q78$1@fred.mathworks.com>...
> I understand that lu can return a psychologically triangular matrix when called with two output arguments. The question is, what does Matlab to to use the psychologically lower triangular matrix efficiently?
>
> In other words, let's say I do
> [L,U] =lu(A);
> to efficiently solve for many different right-hand sides b
> x=U\(L\b)
>
> How efficient is this going to be with L not being strictly lower triangular? Does Matlab somehow recognize that the matrix is psychologically lower triangular, and make note of it someplace for future use?
>
> I know that one could also collect the permutation matrix from Matlab. My question is to the reasoning behind returning just two matrices, with L being possibly not a nice triangular matrix.
>
> Thanks,
>
> Petr
>

When you do L\b, MATLAB looks at L to see if it is lower triangular, or upper, or psychologically lower or upper triangular. This check takes O(n^2) time (less for the sparse case). It does this check each time.

If you want you can use linsolve to save some time, and tell MATLAB what kind of matrix it is. I can't recall if you can tell linsolve that L is psychologically triangular though.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us