choldc - finding inverse of Cholesky decomposition


jbd
03-04-2008, 10:26 AM
Hello

I need to find L-1 from the Cholesky decompostion
A = L . Ltranspose
and have implemented choldc from nr2 in C with additional lines to find inverse as given in chapter 2.9.

I have calculated L(L-1) as a test and do not get the identity matrix, I was just wondering whether anyone else had encountered this problem... or could point out if I'm being stupid and missing something?

Thanks
jbd

davekw7x
03-04-2008, 05:31 PM
... or could point out ... Is it a multiple-choice test?

But seriously, what did you use as a test case? How did you get all of the elements of the calculated matrix L and L-inverse from the return values of choldc? How close did the answer come to expected?

Using choldc (single precision floating point) from nr2 C, here is some output from a matrix used as a test case in xcholdc, where I have added the stuff that I think you are asking about:


Original matrix:
100.000000 15.000000 0.010000
15.000000 2.300000 0.010000
0.010000 0.010000 1.000000

After choldc, diagonal elements of L and L-Transpose are in [p]:
10.000000
0.223607
0.999277

Upper of [a] contains the upper of the original matrix.
Below main diagonal of [a] is below main diagonal of L:
100.000000 15.000000 0.010000
1.500000 2.300000 0.010000
0.001000 0.038013 1.000000

Extracting L and L-Transpose from [p] and lower [a]:
L:
10.000000 0.000000 0.000000
1.500000 0.223607 0.000000
0.001000 0.038013 0.999277
L-Transpose:
10.000000 1.500000 0.001000
0.000000 0.223607 0.038013
0.000000 0.000000 0.999277

Product of L and L-Transpose should be equal to original:
100.000000 15.000000 0.010000
15.000000 2.300000 0.010000
0.010000 0.010000 1.000000

Inverse of L from code at end of section 2.9:
0.100000 0.000000 0.000000
-0.670821 4.472138 0.000000
0.025418 -0.170123 1.000724


Product of L and Inverse of L:
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000


Regards,

Dave