QR-factorisation via Givens rotations Random matrix A = 0.840 0.394 0.783 0.798 0.912 0.198 0.335 0.768 0.278 0.554 0.477 0.629 Q= 0.633 -0.578 0.156 0.601 0.314 -0.712 0.252 0.752 0.439 0.417 -0.031 0.525 R=(should be right-triangular) 1.328 1.191 0.947 0.000 0.621 -0.201 0.000 0.000 0.433 Q*R= (should be equal the original A) 0.840 0.394 0.783 0.798 0.912 0.198 0.335 0.768 0.278 0.554 0.477 0.629 Q^T*Q= (should be equal identity matrix) 1.000 0.000 0.000 0.000 1.000 -0.000 0.000 -0.000 1.000 Givens rotations: linear system Random square matrix A = 0.840 0.394 0.783 0.798 0.912 0.198 0.335 0.768 0.278 0.554 0.477 0.629 0.365 0.513 0.952 0.916 Random right-hand-side b: 0.636 0.717 0.142 0.607 solution x to Ax=b : 0.113 -1.142 0.272 0.975 check: Ax (should == b) : 0.636 0.717 0.142 0.607 Inverse matrix Ai = 2.270 -0.317 0.231 -1.871 1.588 -1.533 3.608 -2.576 2.170 -1.803 -1.512 0.658 -4.049 2.859 -0.542 2.596 Check: Ai*A (should == 1) 1.000 -0.000 0.000 -0.000 0.000 1.000 0.000 0.000 -0.000 0.000 1.000 0.000 -0.000 -0.000 -0.000 1.000 Check: A*Ai (should == 1) 1.000 0.000 0.000 0.000 0.000 1.000 -0.000 0.000 0.000 -0.000 1.000 0.000 -0.000 0.000 0.000 1.000