Inverse of a Matrix

The inverse of a matrix can be used to solve sets of linear equations, too. The inverse is a matrix such that when A is multiplied by its inverse the result is the identity matrix, a matrix with 1.0 along the main diagonal and zero elsewhere.

Then the linear equations are solved by

Generally the inverse is not used in this way because it takes three times more operations than by solving with an LU decomposition (link). However, if an inverse is desired, it is most efficiently calculated by using the LU decomposition and then solving

Then set