Skip to content

Need better error for Sparse \ for non-square matrices #4198

Closed
@timholy

Description

@timholy

There's an error in the show method due to tty_cols no longer being exported, but what I'm really worried about is the last line:

julia> A = float([1 0;1 0; 0 1])
3x2 Array{Float64,2}:
 1.0  0.0
 1.0  0.0
 0.0  1.0

julia> b = float([1:3])
3-element Array{Float64,1}:
 1.0
 2.0
 3.0

julia> A\b
2-element Array{Float64,1}:
 1.5
 3.0

julia> S = sparse(A)
3x2 sparse matrix with 3 Float64 nonzeros:
Error showing value of type SparseMatrixCSC{Float64,Int64}:
ERROR: tty_rows not defined
 in show at sparse/sparsematrix.jl:22
 in anonymous at no file:921
 in with_output_limit at show.jl:898
 in showlimited at show.jl:920
 in writemime at repl.jl:2
 in display at multimedia.jl:109
 in display at multimedia.jl:111
 in display at multimedia.jl:143

julia> S\b
ERROR: Error code -13 in umfpack_solve
 in error at error.jl:21
 in solve at linalg/umfpack.jl:166
 in \ at linalg/umfpack.jl:253

Yikes. Hard to imagine this went undetected for so long.

[ViralBShah: Changed title]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions