Checks if the given matrix is diagonal.
The matrix that is to be tested.
true if the matrix is diagonal, false otherwise