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

Commit

Permalink
RelativeInterior.__hash__: New
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Jun 15, 2021
1 parent e0d2eeb commit e6c3ed5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/sage/geometry/relative_interior.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ def __init__(self, polyhedron):
"""
self._polyhedron = polyhedron

def __hash__(self):
r"""
TESTS::
sage: P = Polyhedron([[1, 2], [3, 4]])
sage: Q = Polyhedron([[3, 4], [1, 2]])
sage: hash(P.relative_interior()) == hash(Q.relative_interior())
True
"""
return hash(self._polyhedron) ^ 1789

def __contains__(self, point):
r"""
Return whether ``self`` contains ``point``.
Expand Down

0 comments on commit e6c3ed5

Please sign in to comment.