JuliaSparse / SparseArrays.jl

SparseArrays.jl is a Julia stdlib
https://sparsearrays.juliasparse.org/
Other
90 stars 52 forks source link

Large sparse matrices are always shown as Braille pattern #22

Open eschnett opened 3 years ago

eschnett commented 3 years ago

I am trying to output a "large" (16x16) sparse matrix to look at its elements. I find that it is always output as Braille pattern. That should not be; there should be a way to see all (non-zero) elements of a sparse matrix. This is possible for dense matrices.

The source code confirms this: File sparsematrix.jl, function Base.show, has a hard-coded limit of <16 for the matrix size that is output; otherwise, only the non-zero pattern is output.

It would be good if the code examined the current display width, as it already does in the preceding function _show_with_braille_patterns.

The work-around I found is to call Base.print_matrix directly.

ViralBShah commented 3 years ago

findnz may be the closest thing for now.