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

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Jun 10, 2020
1 parent 43e6dfb commit 05eba1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/sage/matrix/matrix_integer_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ from .matrix_modn_dense_double cimport Matrix_modn_dense_double

from .matrix_mod2_dense import Matrix_mod2_dense
from .matrix_mod2_dense cimport Matrix_mod2_dense
from sage.rings.finite_rings.finite_field_constructor import GF


from .matrix2 import decomp_seq
Expand Down Expand Up @@ -1553,7 +1554,17 @@ cdef class Matrix_integer_dense(Matrix_dense):
return self._mod_int_c(modulus)

cdef _mod_two(self):
MS = matrix_space.MatrixSpace(IntegerModRing(2), self._nrows, self._ncols)
"""
TESTS:
Check that bug discovered in :trac:`29839` is fixed::
sage: M = Matrix(ZZ, [[0,1],[0,1]])
sage: M._mod_int(2).transpose()
[0 0]
[1 1]
"""
MS = matrix_space.MatrixSpace(GF(2), self._nrows, self._ncols)
return Matrix_mod2_dense(MS, self, True, True)

def _zero_matrix(self):
Expand All @@ -1567,7 +1578,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
[0 0]
[0 1]
"""
MS = matrix_space.MatrixSpace(IntegerModRing(2), self._nrows, self._ncols)
MS = matrix_space.MatrixSpace(GF(2), self._nrows, self._ncols)
cdef Matrix_mod2_dense M = Matrix_mod2_dense(MS)
cdef Py_ssize_t i, j
for i from 0 <= i < self._nrows:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/matrix/matrix_rational_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ from .matrix0 import Matrix as Matrix_base

from .matrix_mod2_dense import Matrix_mod2_dense
from .matrix_mod2_dense cimport Matrix_mod2_dense
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing
from sage.rings.finite_rings.finite_field_constructor import GF
import sage.matrix.matrix_space as matrix_space


Expand Down Expand Up @@ -1437,7 +1437,7 @@ cdef class Matrix_rational_dense(Matrix_dense):
[0 0]
[0 1]
"""
MS = matrix_space.MatrixSpace(IntegerModRing(2), self._nrows, self._ncols)
MS = matrix_space.MatrixSpace(GF(2), self._nrows, self._ncols)
cdef Matrix_mod2_dense M = Matrix_mod2_dense(MS)
cdef Py_ssize_t i, j
for i from 0 <= i < self._nrows:
Expand Down

0 comments on commit 05eba1e

Please sign in to comment.