From 126226211d29ee285f25285d980a12e0419ea609 Mon Sep 17 00:00:00 2001 From: Andrey Novoseltsev Date: Mon, 12 May 2014 15:43:08 -0600 Subject: [PATCH] Use point collections more directly. --- src/sage/geometry/lattice_polytope.py | 9 ++++----- src/sage/geometry/toric_lattice.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 21184ae081a..f19e5173aa2 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -4660,11 +4660,8 @@ def index_of_face_in_lattice(self): sage: face.index_of_face_in_lattice() 1 """ - n = self._polytope.dim() - vertices = self._polytope.vertices_pc().column_matrix().columns() - face_vertices = [vertices[i] for i in self._vertices] - S = span(face_vertices) - return S.index_in(ZZ**n) + S = span(self._polytope.vertices_pc()(self._vertices)) + return S.index_in(self._polytope.lattice()) def interior_points(self): r""" @@ -5005,6 +5002,8 @@ def _palp_canonical_order(V, PM_max, permutations): for k in permutations] Vmin = min(Vs, key=lambda x:x[0]) vertices = map(V.module(), Vmin[0].columns()) + for v in vertices: + v.set_immutable() return (PointCollection(vertices, V.module()), Vmin[1]) def _palp_convert_permutation(permutation): diff --git a/src/sage/geometry/toric_lattice.py b/src/sage/geometry/toric_lattice.py index d20c5d2fc01..0c902ab99cd 100644 --- a/src/sage/geometry/toric_lattice.py +++ b/src/sage/geometry/toric_lattice.py @@ -741,8 +741,8 @@ def span(self, *args, **kwds): else: base_ring = None if base_ring is None or base_ring is ZZ: - return ToricLattice_sublattice(self.ambient_module(), - *args, **kwds) + gens = args[0] if args else kwds["gens"] + return ToricLattice_sublattice(self.ambient_module(), gens) else: return super(ToricLattice_generic, self).span(*args, **kwds)