Use determinant to check invertibility (#678)

Use determinant to check invertibility (#678)

Matrix is invertible iff det⁡(A)≠0\det(A) \neq 0.