###
MI12: Unsymmetric system: approximate-inverse preconditioner

This routine finds an approximate inverse \(\mathbf{M}\) of an \(n \times n\) sparse unsymmetric matrix \(\mathbf{A}\) by attempting to minimize the difference between \(\mathbf{AM}\) and the identity matrix in the Frobenius norm. The process may be improved by first performing a block triangularization of \(\mathbf{A}\) and then finding approximate inverses to the resulting diagonal blocks.

A second entry allows the user to form the matrix-vector products

\[\mathbf{y} = \mathbf{M} \mathbf{z} \qquad \mathrm{and}
\qquad \mathbf{y} = \mathbf{M} ^ T \mathbf{z}.\]

The principal use of such an approximate inverse is likely to be in preconditioning iterative methods for solving the linear system \(\mathbf{Ax} = \mathbf{b}\).