LDL Factorization Fails on Sparse Matrix

조회 수: 3 (최근 30일)
Nathan Zhao
Nathan Zhao 2022년 1월 2일
댓글: Nathan Zhao 2022년 1월 4일
I was playing with matlab's built in finite difference laplacian operator and noticed that the ldl factorization in matlab works when it is dense but somehow fails when it is sparse:
A = (delsq(numgrid('L', 40)));
A2 = full(delsq(numgrid('L', 40)));
bA = sum(A,2);
[LA, DA, PA] = ldl(A);
x = LA'\(DA\(LA\bA));
[L2, D2, P2] = ldl(A2);
x2 = L2'\(D2\(L2\bA));
The Laplacian should be positive definite and is real symmetric so hermitian so the LDL should be applicable but am stumped on why factorizing the sparse version fails.
  댓글 수: 2
Torsten
Torsten 2022년 1월 2일
From the documentation of LDL:
L = ldl(A) returns only the permuted lower triangular matrix L as in the two-output form. The permutation information is lost, as is the block diagonal factor D. By default, ldl references only the diagonal and lower triangle of A, and assumes that the upper triangle is the complex conjugate transpose of the lower triangle. Therefore [L,D,P] = ldl(TRIL(A)) and [L,D,P] = ldl(A)both return the exact same factors. Note, this syntax is not valid for sparse A.
Nathan Zhao
Nathan Zhao 2022년 1월 4일
ah, many thanks! In that case, I see that the appropriate syntax is the [L,D,P,S] = ldl(A). I'd like to follow up on the previous question with this: how is the ldl implemented in Matlab? Or to be more general, I want to confirm the ldl implementation is not using the same algorithm as the lu() function (which I'm aware uses umfpack). The reason I am asking is that when I compare the speed of the ldl and lu on the same laplacian but for larger matrix sizes, say 200 instead of 40, the ldl comes out a lot slower than doing [L,U,P,Q] = lu(A) of the same matrix even though we expect the ldl to be, at best, up to 50% faster. My hunch here is that the ldl is not using some multifrontal solver

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by