Change Matrix::adj() to Matrix::inverse()
The member function Matrix::adj()
of our matrix class computes the adjugate of the matrix. This requires the matrix to be square and is currently only implemented for 2\times2
matrices. In the case the matrix is square and invertible it holds that
\text{adj}(A) = \det(A) A^{-1}
I looked through the code and it appears to me that all calls to Matrix::adj()
are followed by scaling the result with the determinant to obtain the true inverse. Thus, in light of issue #181 (closed) and to reduce code duplication (and because inverse is a concept more commonly known than adjugate) I suggest to replace Matrix::adj()
with Matrix::inverse()
.