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

Commit

Permalink
Changed libs.gap.element.GapElement.matrix() to avoid matrix construc…
Browse files Browse the repository at this point in the history
…tor.
  • Loading branch information
Travis Scrimshaw committed Jan 2, 2016
1 parent c2c3f17 commit 2b1a117
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/libs/gap/element.pyx
Expand Up @@ -1098,10 +1098,11 @@ cdef class GapElement(RingElement):
m = len(entries) // n
if len(entries) % n != 0:
raise ValueError('not a rectangular list of lists')
from sage.matrix.constructor import matrix
from sage.matrix.matrix_space import MatrixSpace
if ring is None:
ring = entries.DefaultRing().sage()
return matrix(ring, n, m, [ x.sage(ring=ring) for x in entries ])
MS = MatrixSpace(ring, n, m)
return MS([x.sage(ring=ring) for x in entries])

_matrix_ = matrix

Expand Down

0 comments on commit 2b1a117

Please sign in to comment.