octave-bug-tracker
[Top][All Lists]

[Octave-bug-tracker] [bug #34850] Behaviour of chol(a,'lower')

 From: Salvatore Filippone Subject: [Octave-bug-tracker] [bug #34850] Behaviour of chol(a,'lower') Date: Mon, 21 Nov 2011 09:49:35 +0000 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

Follow-up Comment #8, bug #34850 (project octave):

Ok, for complex data the situation is even worse: the current code returns the
transpose of the upper factor instead of the conjugate transpose. Test case:
b=[0,1,2,3;
> -1,0,1,2;
> -2,-1,0,1;
> -3,-2,-1,0]
b =

0   1   2   3
-1   0   1   2
-2  -1   0   1
-3  -2  -1   0

octave:5> ca=a+i*b
ca =

12 +  0i    2 +  1i    3 +  2i    4 +  3i
2 -  1i   14 +  0i    5 +  1i    3 +  2i
3 -  2i    5 -  1i   16 +  0i    6 +  1i
4 -  3i    3 -  2i    6 -  1i   16 +  0i

octave:8> chol(ca)
ans =

3.46410 + 0.00000i   0.57735 + 0.28868i   0.86603 + 0.57735i   1.15470 +
0.86603i
0.00000 + 0.00000i   3.68556 + 0.00000i   1.17576 + 0.24872i   0.56527 +
0.49744i
0.00000 + 0.00000i   0.00000 + 0.00000i   3.67048 + 0.00000i   1.01122 +
0.12870i
0.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i   3.50864 +
0.00000i

octave:9> chol(ca,'lower')
ans =

3.46410 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 +
0.00000i
0.57735 + 0.28868i   3.68556 + 0.00000i   0.00000 + 0.00000i   0.00000 +
0.00000i
0.86603 + 0.57735i   1.17576 + 0.24872i   3.67048 + 0.00000i   0.00000 +
0.00000i
1.15470 + 0.86603i   0.56527 + 0.49744i   1.01122 + 0.12870i   3.50864 +
0.00000i

whereas Matlab correctly returns
ca=a+i*b

ca =

12.0000             2.0000 + 1.0000i   3.0000 + 2.0000i   4.0000 + 3.0000i
2.0000 - 1.0000i  14.0000             5.0000 + 1.0000i   3.0000 + 2.0000i
3.0000 - 2.0000i   5.0000 - 1.0000i  16.0000             6.0000 + 1.0000i
4.0000 - 3.0000i   3.0000 - 2.0000i   6.0000 - 1.0000i  16.0000

>> chol(ca)

ans =

3.4641             0.5774 + 0.2887i   0.8660 + 0.5774i   1.1547 + 0.8660i
0             3.6856             1.1758 + 0.2487i   0.5653 + 0.4974i
0                  0             3.6705             1.0112 + 0.1287i
0                  0                  0             3.5086

>> chol(ca,'lower')

ans =

3.4641                  0                  0                  0
0.5774 - 0.2887i   3.6856                  0                  0
0.8660 - 0.5774i   1.1758 - 0.2487i   3.6705                  0
1.1547 - 0.8660i   0.5653 - 0.4974i   1.0112 - 0.1287i   3.5086

_______________________________________________________