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

Commit

Permalink
Fix normal form computation
Browse files Browse the repository at this point in the history
  • Loading branch information
novoselt committed Mar 6, 2017
1 parent 7cbc9de commit fde45ab
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2893,9 +2893,10 @@ def normal_form(self, algorithm="palp", permutation=False):
"""
if self.dim() < self.lattice_dim():
raise ValueError("normal form is not defined for %s" % self)
M = self.lattice()
if algorithm == "palp":
result = read_palp_point_collection(
self.poly_x("N"), self.lattice(), permutation=permutation)
StringIO(self.poly_x("N")), M, permutation=permutation)
elif algorithm == "palp_native":
result = self._palp_native_normal_form(permutation=permutation)
elif algorithm == "palp_modified":
Expand All @@ -2907,13 +2908,11 @@ def normal_form(self, algorithm="palp", permutation=False):
vertices, perm = result
else:
vertices = result
if algorithm == "palp":
vertices = vertices.columns()
M = self.lattice()
vertices = [M(_) for _ in vertices]
for v in vertices:
v.set_immutable()
vertices = PointCollection(vertices, M)
if algorithm != "palp":
vertices = [M(_) for _ in vertices]
for v in vertices:
v.set_immutable()
vertices = PointCollection(vertices, M)
return (vertices, perm) if permutation else vertices

def _palp_modified_normal_form(self, permutation=False):
Expand Down

0 comments on commit fde45ab

Please sign in to comment.