Skip to content

Commit edb121f

Browse files
committed
case of empty matrices
1 parent eb8417b commit edb121f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sage/matrix/matrix2.pyx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8548,9 +8548,18 @@ cdef class Matrix(Matrix1):
85488548
[5 4 3]
85498549
[4 5 3]
85508550
[1 0 2]
8551+
sage: M = matrix(ZZ, 0, 0, [])
8552+
sage: M.permutation_normal_form() # needs sage.graphs
8553+
[]
85518554
"""
85528555
nrows = self.nrows()
85538556
ncols = self.ncols()
8557+
if not nrows or not ncols:
8558+
if not check:
8559+
return self
8560+
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
8561+
return (self, (SymmetricGroup(nrows).one(),
8562+
SymmetricGroup(ncols).one()))
85548563

85558564
# A helper
85568565
def new_sorted_matrix(m):

0 commit comments

Comments
 (0)