# 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


2016  2016   Naqi Jaffery (20060124): examples 
2017  2017  """ 
2018  2018  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 (20120209): examples 
 2036  """ 
 2037  return (self._nrows,self._ncols) 
2019  2038  
2020  2039  
2021  2040  ################################################### 