Skip to content

Commit

Permalink
[vectorarrays] make NumpyVectorSpace hashable
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrave committed Feb 13, 2017
1 parent 8b3dd02 commit ffbff40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pymor/vectorarrays/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def __init__(self, dim, id_=None):
def __eq__(self, other):
return type(other) is type(self) and self.dim == other.dim and self.id == other.id

def __hash__(self):
return hash(self.dim) + hash(self.id)

def zeros(self, count=1, reserve=0):
assert count >= 0
assert reserve >= 0
Expand Down

0 comments on commit ffbff40

Please sign in to comment.