Implement equality operator for matrices