Ticket #12604: trac_12604.patch

File trac_12604.patch, 1.0 KB (added by was, 9 years ago)

apply only this patch

  • sage/matrix/matrix0.pyx

    # HG changeset patch
    # User Benjamin Lundell <benjamin.lundell@gmail.com>
    # Date 1328822053 28800
    # Node ID b71502a6df5c4798512e1ceb9324817bb15a10ec
    # Parent  30fd6118147c777b6982714a9e34820387dcf343
    Trac #12604: Added a method to a matrix which gives the dimensions.
    
    diff --git a/sage/matrix/matrix0.pyx b/sage/matrix/matrix0.pyx
    a b  
    20162016        - Naqi Jaffery (2006-01-24): examples
    20172017        """
    20182018        return self._nrows
     2019   
     2020    def dimensions(self):
     2021        r"""
     2022        Returns the dimensions of this matrix as the tuple (nrows, ncols).
     2023
     2024        EXAMPLES::
     2025   
     2026            sage: M = matrix([[1,2,3],[4,5,6]])
     2027            sage: N = M.transpose()
     2028            sage: M.dimensions()
     2029            (2, 3)
     2030            sage: N.dimensions()
     2031            (3, 2)
     2032
     2033        AUTHORS:
     2034
     2035        - Benjamin Lundell (2012-02-09): examples
     2036        """
     2037        return (self._nrows,self._ncols)
    20192038
    20202039
    20212040    ###################################################