Inverse Matrix by LU Decomposition
One of the application of LU matrix decomposition finds inverse of a square matrix,A. A A -1 = I The square matrix (coefficient matrix) A decomposed into LU (lower triangular and upper triangular) matrix by elementary-row-operations . A = LU after that, inverse matrix A -1 is found by applying forward and back substitution on each column of identity matrix, I and place returning solution vectors x to column of A -1 matrix. Algorithm steps for Matrix Inverse by LU Decomposition Input : a square matrix , A Output : a square matrix, A -1 read matrix A [L,U]= LUDecompose (A) [nrow,ncol]=size(A) I = Identity-matrix(nrow,ncol); iA = zero-matrix(nrow,ncol); For c =1 to ncol Y = forward-substitute (L,I(c)) X = back-substitute (U,Y) A -1 (c,:) = X // set vector X to column of A -1