wrong LU decomposition

David Bateman adb014 at gmail.com
Mon Feb 4 19:19:16 CST 2008


miro simko wrote:
> --------
> Bug report for Octave 2.1.73 configured for i486-pc-linux-gnu
> 
> Description:
> -----------
> 
> octave computes wrong LU decomposition for given matrix A
> correct decomposition A=L*U:
> (1   2   3   4)   (1  0  0  0)   (1  2  3  4)
> (2   9  12  15) = (2  1  0  0) * (0  5  6  7)
> (3  26  41  49)   (3  4  1  0)   (0  0  8  9)
> (5  40 107 135)   (5  6  7  1)   (0  0  0 10)
> 
> octave gives:
> L= (0.20000   0.85714  -0.25000   1.00000)
>    (0.40000   1.00000   0.00000   0.00000)
>    (0.60000  -0.28571   1.00000   0.00000)
>    (1.00000   0.00000   0.00000   0.00000)
> 
> U=(5.00000    40.00000   107.00000   135.00000)
>   (0.00000    -7.00000   -30.80000   -39.00000)
>   (0.00000     0.00000   -32.00000   -43.14286)
>   (0.00000     0.00000     0.00000    -0.35714)
> 
> 
> Repeat-By:
> ---------
> L = [1,0,0,0; 2,1,0,0; 3,4,1,0; 5,6,7,1];
> U = [1,2,3,4; 0,5,6,7; 0,0,8,9; 0,0,0,10];
> A = L*U;
> %A = [1,2,3,4; 2,9,12,15; 3,26,41,49; 5,40,107,135];
> [L2,U2] = lu(A);

norm (L2*U2 - A)

ans =  4.4409e-16

Nothing here, move along..

D.



More information about the Bug-octave mailing list