This module illustrates Gauss-Jordan elimination for computing the inverse of a matrix. The initial matrix is reduced to diagonal form by applying a sequence of elementary elimination matrices to annihilate both the subdiagonal and superdiagonal entries in successive columns. Each elementary elimination matrix is composed of an identity matrix plus some multipliers in the relevant column. Row interchanges (pivoting) can be used to avoid potential division by zero and limit the magnitudes of the multipliers, thereby enhancing numerical stability. The same sequence of elementary elimination matrices is also applied to an auxiliary matrix that is initially the identity matrix. After the original matrix has reached diagonal form, it is scaled to obtain an identity matrix. The same scaling applied to the transformed auxiliary matrix yields the inverse of the original matrix.
The user first selects a matrix size
Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 2.4.8, especially Example 2.18.
Developers: Jessica Schoen and Michael Heath