Let

*A*be a square matrix. An**LU factorization**refers to the factorization of A, with proper row and/or column orderings or permutations, into two factors, a lower triangular matrix*L*and an upper triangular matrix*U*,
In the lower triangular matrix all elements above the diagonal are zero, in the upper triangular matrix, all the elements below the diagonal are zero. For example, for a 3-by-3 matrix

*A*, its LU decomposition looks like this: