Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #29249: Fixing determinant for the zero matrix over the p-adics
This fixes the bug below: {{{ sage: matrix(Qp(37),[0]).determinant() ------------------------------------------------------------------------ --- UnboundLocalError Traceback (most recent call last) <ipython-input-323-f9ac4bb66315> in <module>() ----> 1 matrix(Zp(Integer(37)),[Integer(0)]).determinant() /Applications/sage-dev/local/lib/python3.7/site- packages/sage/matrix/matrix2.pyx in sage.matrix.matrix2.Matrix.determinant (build/cythonized/sage/matrix/matrix2.c:14548)() 1640 R = self._base_ring 1641 if hasattr(R, '_matrix_determinant'): -> 1642 d = R._matrix_determinant(self) 1643 self.cache('det', d) 1644 return d /Applications/sage-dev/local/lib/python3.7/site- packages/sage/rings/padics/local_generic.py in _matrix_determinant(self, M) 1587 break 1588 val = curval -> 1589 if S[pivi,pivj] == 0: 1590 if track_precision: 1591 return R(0, valdet + (n-piv)*val - shift) UnboundLocalError: local variable 'pivi' referenced before assignment }}} URL: https://trac.sagemath.org/29249 Reported by: edgarcosta Ticket author(s): Edgar Costa Reviewer(s): Travis Scrimshaw
- Loading branch information