[討論] Householder Reflection: a 3x3 Matrix …
The following is a algorithm to transform an matrix A to
an upper triangular one by Householder reflection:
p1=0.9
p2=p1*p1
A=[1 p1 p2; p1 1 p1; p2 p1 1]
u=[A(1,1); A(2,1); A(3,1)]
u=u-norm(u)*[1;0;0]
v=u/norm(u)
I=eye(3) % a 3x3 identity matrix.
Q=I-2*v*v'
A=Q*A
A1=[A(2,2) A(2,3); A(3,2) A(3,3)]
u=[A1(1,1); A1(2,1)]
u=u-norm(u)*[1;0]
v=u/norm(u)
I=eye(2) % a 2x2 identity matrix.
Q=I-2*v*v'
Q=[1 0 0; 0 Q(1,1) Q(1,2); 0 Q(2,1) Q(2,2)]
A=Q*A
Please copy them line by line into matlab command window to see the result.
Also see the relevant wiki webpage to get better understanding.
http://en.wikipedia.org/wiki/QR_decomposition
aluba1
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.2.128
※ 編輯: aluba1 來自: 123.195.2.128 (05/20 21:09)