@@ -1847,6 +1847,16 @@ cdef class Matrix(sage.structure.element.Matrix):
1847
1847
:class:`~sage. typeset. unicode_art. UnicodeArt` which support line
1848
1848
breaking of wide matrices that exceed the window width
1849
1849
1850
+ - ``left_border``, ``right_border`` -- sequence ( default: ``None``) ;
1851
+ if not ``None``, call :func:`str` on the elements and use the
1852
+ results as labels for the rows of the matrix. The labels appear
1853
+ outside of the parentheses.
1854
+
1855
+ - ``top_border``, ``bottom_border`` -- sequence ( default: ``None``) ;
1856
+ if not ``None``, call :func:`str` on the elements and use the
1857
+ results as labels for the columns of the matrix. The labels appear
1858
+ outside of the parentheses.
1859
+
1850
1860
EXAMPLES::
1851
1861
1852
1862
sage: R = PolynomialRing( QQ,6,'z')
@@ -1974,6 +1984,32 @@ cdef class Matrix(sage.structure.element.Matrix):
1974
1984
sage: matrix( R, [[2/3 - 10^6 * x^3 + 3 * y + O(x, y)^4 ]])
1975
1985
[2/3 + 3*y - 1000000*x^3 + O(x, y)^4 ]
1976
1986
sage: matrix. options. _reset( )
1987
+
1988
+ Edge cases of matrices with borders::
1989
+
1990
+ sage: print( matrix( ZZ, 0, 0) . str(
1991
+ .... : top_border=[], bottom_border=[ ], left_border=[], right_border=[ ]))
1992
+ []
1993
+ sage: print( matrix( ZZ, 0, 4) . str(
1994
+ .... : unicode=True,
1995
+ .... : top_border='abcd', bottom_border=range( 4)))
1996
+ ( )
1997
+ sage: print( matrix( ZZ, 1, 4) . str(
1998
+ .... : unicode=True,
1999
+ .... : top_border='abcd', bottom_border=range( 4)))
2000
+ a b c d
2001
+ ( 0 0 0 0)
2002
+ 0 1 2 3
2003
+ sage: print( matrix( ZZ, 2, 4) . str(
2004
+ .... : unicode=True,
2005
+ .... : top_border='abcd', bottom_border=range( 4) , left_border='uv'))
2006
+ a b c d
2007
+ u⎛0 0 0 0⎞
2008
+ v⎝0 0 0 0⎠
2009
+ 0 1 2 3
2010
+ sage: print( matrix( ZZ, 2, 0) . str(
2011
+ .... : top_border='', left_border='uv', right_border=['*', '' ]))
2012
+ []
1977
2013
"""
1978
2014
cdef Py_ssize_t nr, nc, r, c
1979
2015
nr = self ._nrows
0 commit comments