Changed hashCode() method for Matrix to sum Double.hashCode().