Dividing matrices

In this subsection, you will learn how to divide two matrices using the Go code of divMat.go, which is going to be presented in five parts. The core function of divMat.go is called inverseMatrix(). What inverseMatrix() mainly implements is the calculation of the inverse matrix of a given matrix, which is a pretty complex task. There are ready-to-use Go packages that allow you to inverse a matrix, but I have decided to implement it from scratch.

Not all matrices are invertible. Non-square matrices are not invertible. A square matrix that is not invertible is called singular or degenerate – this happens when the determinant of the square matrix is 0. Singular matrices are very rare.

The divMat.go utility requires a single ...

Get Mastering Go - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.