LU factorization with decreasing elements on the main diagonal of U

Answers (1)

Obviously not
A=[1 10 9;
5 1 9;
2 8 1]
A = 3×3
1 10 9 5 1 9 2 8 1
[L,U,P]=lu(A)
L = 3×3
1.0000 0 0 0.2000 1.0000 0 0.4000 0.7755 1.0000
U = 3×3
5.0000 1.0000 9.0000 0 9.8000 7.2000 0 0 -8.1837
P = 3×3
0 1 0 1 0 0 0 0 1
But you can fix the progression of abs(diag(U)) in any arbitray decrasing sequance you want, just scale appropiately L.
Here I select the sequene of U(1,1).*2.^(-(1:n-1))
% Fix it, assuming A is not singular
Ukk = abs(U(1,1));
for k=2:size(U,1)
s = Ukk/(2*abs(U(k,k)));
U(k,:) = s*U(k,:);
L(:,k) = L(:,k)/s;
Ukk = abs(U(k,k));
end
L
L = 3×3
1.0000 0 0 0.2000 3.9200 0 0.4000 3.0400 6.5469
U
U = 3×3
5.0000 1.0000 9.0000 0 2.5000 1.8367 0 0 -1.2500
P'*L*U % close to A
ans = 3×3
1 10 9 5 1 9 2 8 1
In some sense the question of scaling U alone is trivial and sort of useless if you don't specify what L should be.
Note that MATLAB returns L such that diag(L) are 1.

5 Comments

Thank you.
I would like to leave the diagonal elements of L equal to 1 and I would like to order the diagonal elements of U in such a way that their modules are decreasing.
Then it is not possible in general.
If you need similar property, use qr with permutation.
I'll give you a simple counter example where no permutation can achieve what you ask for. The example is 2 x 2, there is 2 pemutations of 1:2, both them don't provide U with absolute values of the diagonal decreasing.
In both case the diagonal od U is [1,2]; which is non decreasing
Note that once you impose P, and diag(L)=1, the LU factorization is unique.
A = [1 0; 0 2]
A = 2×2
1 0 0 2
p = perms(1:2);
for k=1:size(p,1)
P = eye(2);
P = P(:,p(k,:));
[L,U] = lu(P*A)
end
L = 2×2
0 1 1 0
U = 2×2
1 0 0 2
L = 2×2
1 0 0 1
U = 2×2
1 0 0 2
% and of course
[L,U,P] = lu(A)
L = 2×2
1 0 0 1
U = 2×2
1 0 0 2
P = 2×2
1 0 0 1
Thank you, you are right.
Last question, is there any option in matlab to generate a PLU factorization such that is decreasing without having to modify a lu factorization previously calculated by matlab?

Sign in to comment.

Categories

Asked:

on 25 Sep 2023

Commented:

on 25 Sep 2023

Community Treasure Hunt

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

Start Hunting!