Ticket #12020: trac_12020.2.patch

File trac_12020.2.patch, 1.2 KB (added by jdemeyer, 8 years ago)

Same patch with corrected doc formatting

  • sage/matrix/matrix_space.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1321213988 28800
    # Node ID 138040b4d7dab745b5c38a402fcde88ebd2654be
    # Parent  9c4acd02e71ff3618db21ed48751205042c0557b
    bug in zero_matrix rewrite in matrix_space.py
    
    diff --git a/sage/matrix/matrix_space.py b/sage/matrix/matrix_space.py
    a b  
    475475            True
    476476            sage: mat2 = mat.change_ring(QQ); mat2.is_mutable()
    477477            True
     478
     479        TESTS:
     480       
     481        Ensure that trac 12020 is fixed::
     482       
     483            sage: A = MatrixSpace(CyclotomicField(4),60,30)(0)
     484            sage: B = A.augment(A)       
    478485        """
    479486        if entries is None or entries == 0:
    480487            if self._copy_zero: # faster to copy than to create a new one.
    481488                return self.zero_matrix().__copy__()
    482489            else:
    483                 return self.__matrix_class(self, None, coerce=coerce, copy=copy)
     490                return self.__matrix_class(self, 0, coerce=coerce, copy=copy)
    484491
    485492        if isinstance(entries, (list, tuple)) and len(entries) > 0 and \
    486493           sage.modules.free_module_element.is_FreeModuleElement(entries[0]):