For a SPD matrix A, there exists Cholesky factorization $A=LL^T$ or $A=R^TR$, where L, R are a lower and upper triangular matrix, respectively.

Also in matlab, there has a command R = chol(A) which produces $A=R^TR$. and another command L = chol(A,'lower') which produces $A=LL^T$. But when I implement these two commands with a same large sparse SPD matrix A, L = chol(A,'lower') is faster than R = chol(A) so mysterious. why this happens? Thanks.

n =400;
A = gallery('poisson',n);

R = chol(A);%   generate the triangular matrix such that A = R'*R

L = chol(A,'lower');%   generate the lower matrix such that A = L*L'

I have run the example 3 times and the numerical results are as follows which indeed demonstrates that the above words what I said (my cpu is 8GB memory and matlab 2018b):

Elapsed time is 12.089711 seconds.
Elapsed time is 8.467380 seconds.

Elapsed time is 10.372768 seconds.
Elapsed time is 8.131158 seconds.

Elapsed time is 10.027861 seconds.
Elapsed time is 8.105706 seconds.
  • 2
    $\begingroup$ It's clearly something about the implementation of the sparse Cholesky factorization in MATLAB. MATLAB uses Tim Davis's CHOLMOD for this factorization. You could test CHOLMOD to see if it has the same issue and investigate the code to understand the particular issue. In any case it's a matter of implementation and not really appropriate for this group. $\endgroup$ – Brian Borchers Nov 6 '19 at 2:36
  • $\begingroup$ Get it. Thanks for your reply. I understand it now. $\endgroup$ – sunshine Nov 6 '19 at 4:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.