Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
new hash function for matrix_dense
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Jul 30, 2017
1 parent 74b0302 commit 1e1263f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/sage/matrix/matrix_dense.pyx
Expand Up @@ -69,13 +69,7 @@ cdef class Matrix_dense(matrix.Matrix):
if not self._is_immutable:
raise TypeError("mutable matrices are unhashable")

v = self._list()
cdef Py_ssize_t i
cdef long h = 0

for i from 0 <= i < len(v):
h = h ^ (i * hash(v[i]))

cdef long h = hash(tuple(self._list()))
if h == -1:
h = -2

Expand Down

0 comments on commit 1e1263f

Please sign in to comment.