Hi,
I am currently investigating the efficiency of matrix-inversion-methods and came across the Cholesky decomposition. I then implemented the cholesky in Matlab and compared it to the built-in chol()-function.
What you can see in the graph below is a Benchmark of my implemented Cholesky decompositions and the chol()-function: – "Cholesky" is the regular Cholesky Decomposition – "Incremental Cholesky" is a method where an old Cholesky decomp of a Matrix A is used to calculate the decomposition of an incremented Matrix B with one extra row and column
Both functions are also implemented in Mex-C which improved performance a little bit.
Here is the code of my Cholesky implementation:
function L = cholMatlab(M)n = length( M );L = zeros( n, n );for i=1:n L(i, i) = sqrt(M(i, i) - L(i, :)*L(i, :)'); for j=(i + 1):n L(j, i) = (M(j, i) - L(i,:)*L(j ,:)')/L(i, i); endendend
Can you tell me why the chol()-function performs so much better?
Best regards
Edit: Should have mentioned this: The calculations are based on random full symmetric positive definite matrices.
Best Answer