Matrix Inverse

Overview


The matrix inverse of a matrix {% A %}, {% A^{-1} %} is the matrix such
{% A^{-1}A = I %}
and
{% AA^{-1} = I %}
if such a matrix exists.

Matrix Inverse Algorithm


The algorithm for computing the matrix inverse is based on the LU decomposition.

First, it computes the LU decomposition of the matrix
{% M = LU %}
Then, it computes the inverse of the L and U matrices.
{% (LU)^{-1} = U^{-1} L^{-1} %}
When partial pivoting is used in the LU decomposition, the pivoting must be undone.

Computing Matrix Inverse


The linear-algebra module provides a method for calculating the matrix inverse.


let la = await import('/lib/liniear-albgebra/v1.0.0/linear-algebra.mjs');
var ans = la.inverse(matrix1);
					
Try it!

Contents