Is it worth adding a more economical printing of SparseMatrix in 
printing/repr.py?

def _print_Sparse(m):
    """return shortest representation for SparseMatrix"""
    o1 = m.shape[0], m.shape[1], m._smat
    o2 = Matrix(m).tolist()
    o3 = m.shape[0], m.shape[1], Matrix(m)._mat
    l1, l2, l3 = [len(str(i)) for i in (o1, o2, o3)]
    if l1 < l2 and l1 < l3:
        return 'SparseMatrix(%i, %i, %s)' % o1
    if l2 < l1 and l2 < l3:
        return 'SparseMatrix(%s)' % o2
    return 'SparseMatrix(%i, %i, %s)' % o3

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to