Previous Up Next

15.3.4  LQ decomposition (HP compatible)

The LQ decomposition of a matrix A is A=LQP, where L is lower triangular the same size as A (if A is not square, then ℓi,j=0 for i>j), Q is an orthogonal matrix, and P is a permutation matrix.

The LQ command finds the LQ decomposition of a matrix.

Examples

L,Q,P:=LQ([[4,0,0],[8,-4,3]])
     
⎡
⎢
⎢
⎣
⎡
⎢
⎣
4.00.00.0
8.05.0−4.4408920985×10−16
⎤
⎥
⎦
,
⎡
⎢
⎢
⎣
1.00.00.0
0.0−0.80.6
0.0−0.6−0.8
⎤
⎥
⎥
⎦
,
⎡
⎢
⎢
⎣
100
010
001
⎤
⎥
⎥
⎦
⎤
⎥
⎥
⎦
          
L,Q,P:=LQ([[24,18],[30,24]])
     
⎡
⎢
⎣
⎡
⎢
⎣
−30.00.0
−38.4−1.2
⎤
⎥
⎦
,
⎡
⎢
⎣
−0.8−0.6
0.6−0.8
⎤
⎥
⎦
,
⎡
⎢
⎣
10
01
⎤
⎥
⎦
⎤
⎥
⎦
          

In the above examples, LQ=PA.


Previous Up Next