1 / 6

LU decomposition

LU decomposition. 日期: 2014/9/30 助教:汪柏岑 授課老師:徐國錦 教授. LU 分解. Doolittle’s method Crout’s method Choleski’s method. Doolittle’s method. library(Matrix ) B=matrix(c(1,2,0,1)) mm <- matrix(c(4,-1,-1,0,-1,4,0,-1,-1,0,4,-1,0,-1,-1,4), nrow =4) lum <- lu (mm) elu <- expand( lum )

Download Presentation

LU decomposition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LU decomposition 日期:2014/9/30 助教:汪柏岑 授課老師:徐國錦 教授

  2. LU 分解 • Doolittle’s method • Crout’smethod • Choleski’s method

  3. Doolittle’s method

  4. library(Matrix) B=matrix(c(1,2,0,1)) mm <- matrix(c(4,-1,-1,0,-1,4,0,-1,-1,0,4,-1,0,-1,-1,4),nrow=4) lum<- lu(mm) elu <- expand(lum) y=solve(elu$L)%*%B x=solve(elu$U)%*%y elu$L elu$U

  5. Choleski’s method

  6. Exercise 4X4 矩陣 A=matrix(c(4,-1,-1,0,-1,4,0,-1,-1,0,4,-1,0,-1,-1,4),4,4) #定義A矩陣 b=matrix(c(1,2,0,1),4,1) #定義b矩陣 U=chol(A) #使用Choleski's method 算出U L=t(chol(A)) #求U之轉置矩陣L y=solve(L)%*%b #求y矩陣 x=solve(U)%*%y #求x矩陣 L的反矩陣 矩陣相乘 A=LU  Ax=b  Lux=b  Ly=b Ux=y

More Related