@@ -346,7 +346,9 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
346
346
347
347
348
348
def str (self , rep_mapping = None , zero = None , plus_one = None , minus_one = None ,
349
- *, unicode = False , shape = None , character_art = False ):
349
+ *, unicode = False , shape = None , character_art = False ,
350
+ left_border = None , right_border = None ,
351
+ top_border = None , bottom_border = None ):
350
352
r """
351
353
Return a nice string representation of the matrix.
352
354
@@ -384,6 +386,16 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
384
386
:class:`~sage. typeset. unicode_art. UnicodeArt` which support line
385
387
breaking of wide matrices that exceed the window width
386
388
389
+ - ``left_border``, ``right_border`` -- sequence ( default: ``None``) ;
390
+ if not ``None``, call :func:`str` on the elements and use the
391
+ results as labels for the rows of the matrix. The labels appear
392
+ outside of the parentheses.
393
+
394
+ - ``top_border``, ``bottom_border`` -- sequence ( default: ``None``) ;
395
+ if not ``None``, call :func:`str` on the elements and use the
396
+ results as labels for the columns of the matrix. The labels appear
397
+ outside of the parentheses.
398
+
387
399
EXAMPLES::
388
400
389
401
sage: B = matrix( GF( 2) , 3, 3, [0, 1, 0, 0, 1, 1, 0, 0, 0 ])
@@ -416,13 +428,19 @@ cdef class Matrix_mod2_dense(matrix_dense.Matrix_dense): # dense or sparse
416
428
# Set the mapping based on keyword arguments
417
429
# We ignore minus_one (it's only there for compatibility with Matrix)
418
430
if (rep_mapping is not None or zero is not None or plus_one is not None
419
- or unicode or shape is not None or character_art):
431
+ or unicode or shape is not None or character_art
432
+ or left_border is not None or right_border is not None
433
+ or top_border is not None or bottom_border is not None ):
420
434
# Shunt mappings off to the generic code since they might not be
421
435
# single characters
422
436
return matrix_dense.Matrix_dense.str(self , rep_mapping = rep_mapping,
423
437
zero = zero, plus_one = plus_one,
424
438
unicode = unicode , shape = shape,
425
- character_art = character_art)
439
+ character_art = character_art,
440
+ left_border = left_border,
441
+ right_border = right_border,
442
+ top_border = top_border,
443
+ bottom_border = bottom_border)
426
444
427
445
if self ._nrows == 0 or self ._ncols == 0 :
428
446
return " []"
0 commit comments