multiplicative-inverse ( x -- y )
Extra matrix operations

Prev:>cofactors ( matrix -- matrix' )
Next:covariance-matrix ( matrix -- cov )


Vocabulary
math.matrices.extras

Inputs
xa matrix


Outputs
ya matrix


Word description
Calculate the multiplicative inverse of the input.

If the input is a square-matrix, this is done by multiplying the transpose of the cofactors of the minors of the input matrix by the inverse of the determinant of the input matrix.

Notes
The shape of the input matrix is preserved in the output.
This word is intended for use with "flat" (2-dimensional) matrices.
This word assumes that elements of the input matrix are compatible with the following words:
determinant ( matrix -- determinant )

>cofactors ( matrix -- matrix' )

1/det ( matrix -- 1/det )


Errors
non-square-determinant if the input matrix is not a square-matrix.

Definition