Opened 6 years ago

Closed 6 years ago

#14785 closed defect (duplicate)

Trouble to display a big matrix in the notebook

Reported by: bouillot Owned by: jason, mpatel, was, kini
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: notebook Keywords: matrix, notebook
Cc: nthiery Merged in:
Authors: Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Hello,

I want to report something I think to be a bug that I've seen in the notebook. It concerns the display of (big) matrix.

For example, you can obtain it by the following, when the typeset option is not marked:

sage: matrix(19,20,0)
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
sage: matrix(20,20)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_47.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bWF0cml4KDIwLDIwKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpsCxNoh/___code___.py", line 3, in <module>
    exec compile(u'matrix(_sage_const_20 ,_sage_const_20 )
  File "", line 1, in <module>
    
  File "matrix0.pyx", line 1729, in sage.matrix.matrix0.Matrix.__repr__ (sage/matrix/matrix0.c:9374)
  File "/opt/sagemath/sage-5.9-optional-i686-Linux/local/lib/python2.7/site-packages/sage/misc/sageinspect.py", line 1915, in sage_getvariablename
    for frame in inspect.stack():
  File "/opt/sagemath/sage-5.9-optional-i686-Linux/local/lib/python/inspect.py", line 1054, in stack
    return getouterframes(sys._getframe(1), context)
  File "/opt/sagemath/sage-5.9-optional-i686-Linux/local/lib/python/inspect.py", line 1032, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/opt/sagemath/sage-5.9-optional-i686-Linux/local/lib/python/inspect.py", line 1007, in getframeinfo
    lines, lnum = findsource(frame)
  File "/opt/sagemath/sage-5.9-optional-i686-Linux/local/lib/python/inspect.py", line 528, in findsource
    if not sourcefile and file[0] + file[-1] != '<>':
IndexError: string index out of range

When the typeset option is marked, sage compute correctly the matrix (20,20), but nothing is written.

When you use a terminal, this error doesn't happen:

sage: a=matrix (20,20)
sage: a 
20 x 20 dense matrix over Integer Ring (type 'print a.str()' to see all of the entries)
sage: a.str()
'[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]'

Thanks a lot,

Olivier Bouillot

Change History (5)

comment:1 Changed 6 years ago by nbruin

  • Milestone changed from sage-5.11 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

Dup of #14579.

comment:2 Changed 6 years ago by nbruin

See also sage-devel thread about the use of sage_getvariablename (which triggers the problem here) in matrix.repr

comment:3 Changed 6 years ago by bouillot

Thanks for your answer, and sorry for the duplication of the ticket.

comment:4 Changed 6 years ago by tscrim

  • Authors Olivier Bouillot deleted
  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

comment:5 Changed 6 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.