From 56dcddfb6a4d1210426370309f4f5de707362efe Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Thu, 19 Mar 2020 10:19:41 +0100 Subject: [PATCH] src/simplification of doctests --- .../combinatorial_polyhedron/conversions.pyx | 12 ++++-------- .../polyhedron_face_lattice.pyx | 14 +++++--------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx index 135000a9523..f35d59ff6c1 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx @@ -254,10 +254,9 @@ def incidence_matrix_to_bit_rep_of_facets(matrix): ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: from libc.stdint cimport uint64_t ....: - ....: def bit_rep_to_Vrep_list_wrapper(list_of_faces, index): + ....: def bit_rep_to_Vrep_list_wrapper(ListOfFaces faces, index): ....: cdef MemoryAllocator mem = MemoryAllocator() ....: cdef size_t *output - ....: cdef ListOfFaces faces = list_of_faces ....: output = mem.allocarray(faces.n_atoms, ....: sizeof(size_t)) ....: cdef uint64_t * data = faces.data[index] @@ -343,10 +342,9 @@ def incidence_matrix_to_bit_rep_of_Vrep(matrix): ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: from libc.stdint cimport uint64_t ....: - ....: def bit_rep_to_Vrep_list_wrapper(list_of_faces, index): + ....: def bit_rep_to_Vrep_list_wrapper(ListOfFaces faces, index): ....: cdef MemoryAllocator mem = MemoryAllocator() ....: cdef size_t *output - ....: cdef ListOfFaces faces = list_of_faces ....: output = mem.allocarray(faces.n_atoms, ....: sizeof(size_t)) ....: cdef uint64_t * data = faces.data[index] @@ -439,10 +437,9 @@ def facets_tuple_to_bit_rep_of_facets(tuple facets_input, size_t n_Vrep): ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: from libc.stdint cimport uint64_t ....: - ....: def bit_rep_to_Vrep_list_wrapper(list_of_faces, index): + ....: def bit_rep_to_Vrep_list_wrapper(ListOfFaces faces, index): ....: cdef MemoryAllocator mem = MemoryAllocator() ....: cdef size_t *output - ....: cdef ListOfFaces faces = list_of_faces ....: output = mem.allocarray(faces.n_atoms, ....: sizeof(size_t)) ....: cdef uint64_t * data = faces.data[index] @@ -506,10 +503,9 @@ def facets_tuple_to_bit_rep_of_Vrep(tuple facets_input, size_t n_Vrep): ....: from sage.ext.memory_allocator cimport MemoryAllocator ....: from libc.stdint cimport uint64_t ....: - ....: def bit_rep_to_Vrep_list_wrapper(list_of_faces, index): + ....: def bit_rep_to_Vrep_list_wrapper(ListOfFaces faces, index): ....: cdef MemoryAllocator mem = MemoryAllocator() ....: cdef size_t *output - ....: cdef ListOfFaces faces = list_of_faces ....: output = mem.allocarray(faces.n_atoms, ....: sizeof(size_t)) ....: cdef uint64_t * data = faces.data[index] diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx index ae55be15488..a38abcb653f 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx @@ -336,14 +336,12 @@ cdef class PolyhedronFaceLattice: ....: from sage.geometry.polyhedron.combinatorial_polyhedron.base \ ....: cimport CombinatorialPolyhedron, FaceIterator, PolyhedronFaceLattice ....: - ....: def find_face_from_iterator(it, C1): - ....: cdef FaceIterator face_iter = it - ....: cdef CombinatorialPolyhedron C = C1 + ....: def find_face_from_iterator(FaceIterator it, CombinatorialPolyhedron C): ....: C._record_all_faces() ....: cdef PolyhedronFaceLattice all_faces = C._all_faces ....: if not (all_faces.dual == it.dual): ....: raise ValueError("iterator and allfaces not in same mode") - ....: return all_faces.find_face(face_iter.structure.current_dimension, face_iter.structure.face) + ....: return all_faces.find_face(it.structure.current_dimension, it.structure.face) ....: ''') sage: P = polytopes.permutahedron(4) sage: C = CombinatorialPolyhedron(P) @@ -422,15 +420,13 @@ cdef class PolyhedronFaceLattice: ....: from sage.geometry.polyhedron.combinatorial_polyhedron.base \ ....: cimport CombinatorialPolyhedron, FaceIterator, PolyhedronFaceLattice ....: - ....: def face_via_all_faces_from_iterator(it, C1): - ....: cdef FaceIterator face_iter = it - ....: cdef CombinatorialPolyhedron C = C1 - ....: cdef int dimension = face_iter.structure.current_dimension + ....: def face_via_all_faces_from_iterator(FaceIterator it, CombinatorialPolyhedron C): + ....: cdef int dimension = it.structure.current_dimension ....: C._record_all_faces() ....: cdef PolyhedronFaceLattice all_faces = C._all_faces ....: if not (all_faces.dual == it.dual): ....: raise ValueError("iterator and allfaces not in same mode") - ....: index = all_faces.find_face(dimension, face_iter.structure.face) + ....: index = all_faces.find_face(dimension, it.structure.face) ....: return all_faces.get_face(dimension, index) ....: ''') sage: P = polytopes.permutahedron(4)