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

Commit

Permalink
check rank before inverting
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 17, 2020
1 parent 4427340 commit ccaf79d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sage/matrix/matrix_gf2e_dense.pyx
Expand Up @@ -981,8 +981,13 @@ cdef class Matrix_gf2e_dense(matrix_dense.Matrix_dense):
cdef Matrix_gf2e_dense A
A = Matrix_gf2e_dense.__new__(Matrix_gf2e_dense, self._parent, 0, 0, 0)

if self._nrows and self._nrows == self._ncols:
if self.rank() != self._nrows:
raise ZeroDivisionError("Matrix does not have full rank.")

if self._nrows:
sig_on()
mzed_invert_newton_john(A._entries, self._entries)
sig_off()

return A

Expand Down

0 comments on commit ccaf79d

Please sign in to comment.