Introduction to scientific Computing A Matrix Vector Approach Using Matlab Written by Charles FVan Loan 陈文斌 Wbchen(fudan. edu. cn 复日大学
Introduction to Scientific Computing -- A Matrix Vector Approach Using Matlab Written by Charles F.Van Loan 陈 文 斌 Wbchen@fudan.edu.cn 复旦大学
Chapter 6 Linear systems T trangular Problems Banded problems Full problems A nalySIS
Chapter 6 Linear systems • Triangular Problems • Banded Problems • Full Problems • Analysis
Triangular problems 7100x1「b 22 0‖x 31132 x2=(b2-l21x1)/l2 23 Forward substitution X ∑
= 3 2 1 3 2 1 31 32 33 21 22 11 0 0 0 b b b x x x l l l l l l 3 3 3 1 1 3 2 2 2 3 2 2 2 1 1 2 2 1 1 1 1 ( )/ ( )/ / x b l x l x l x b l x l x b l = − − = − = Triangular Problems ii i j i i ij j x b l x /l 1 1 = − − = Forward substitution
for i=1:n x(1)=b(1) rj=1:i-1 x(1)=x(1)-L(Jj)*x( enc x(1=x(i/L(ii floops end x(1)=b(1)/L(1,1); for i=2: n Row oriented x()-(b(i)-L(i,1;-1)*x(1:i-1)/L(i) end
for i=1:n x(i)=b(i); for j=1:i-1 x(i)=x(i)-L(i,j)*x(j); end x(i)=x(i)/L(i,i); end x(1)=b(1)/L(1,1); for i=2:n x(i)=(b(i)-L(i,1:i-1)*x(1:i-1))/L(i,i); end Row oriented floops
Column-oriented 200x1|6 150 798 50 2 98 16 -1/5 8x3=-16-9(-1/5)國x3=-71/40
Column-oriented = 5 2 6 7 9 8 1 5 0 2 0 0 3 2 1 x x x − − = − = 16 1 7 1 3 5 2 9 8 5 0 3 2 x x x1 = 3 x2 = −1/5 8 16 9( 1/ 5) x3 = − − − x3 = −71/ 40