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

Commit

Permalink
Do not rely on distances for containment check
Browse files Browse the repository at this point in the history
Old code hackishly relied on exceptions thrown out in certain cases.
  • Loading branch information
novoselt committed Feb 18, 2017
1 parent f4a696b commit b4410f1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -4886,12 +4886,8 @@ def part_of_point(self, i):
raise ValueError("the origin belongs to all parts!")
point = self._Delta_polar.point(i)
for part, nabla in enumerate(self.nablas()):
try:
if min(nabla.distances(point)) >= 0:
return part
except ArithmeticError:
# point is not even in the affine subspace of nabla
continue
if point in nabla:
return part


_palp_dimension = None
Expand Down

0 comments on commit b4410f1

Please sign in to comment.