SparseArrays.jl icon indicating copy to clipboard operation
SparseArrays.jl copied to clipboard

`sort!(::SparseMatrixCSC)` throws on Julia nightly [regression]

Open LilithHafner opened this issue 2 years ago • 0 comments

julia> sort!(sprand(1000, 1000, .01), dims=1)
ERROR: `reinterpret` on sparse arrays is discontinued.
Try reinterpreting the value itself instead.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] reinterpret(#unused#::Type, A::SparseVector{Float64, Int64})
   @ SparseArrays /Applications/Julia-1.9.app/Contents/Resources/julia/share/julia/stdlib/v1.9/SparseArrays/src/abstractsparse.jl:79
 [3] sort!(v::SubArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, false}, lo::Int64, hi::Int64, ::Base.Sort.AdaptiveSortAlg, o::Base.Sort.Float.Right, t::SparseVector{Float64, Int64})
   @ Base.Sort ./sort.jl:860
 [4] fpsort!(v::SubArray{Float64, 1, SparseMatrixCSC{Float64, Int64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, false}, a::Base.Sort.AdaptiveSortAlg, o::Base.Order.ForwardOrdering, t::SparseVector{Float64, Int64})
   @ Base.Sort.Float ./sort.jl:1590
 [5] sort!
   @ ./sort.jl:1597 [inlined]
 [6] _sort!(A::SparseMatrixCSC{Float64, Int64}, #unused#::Val{1}, alg::Base.Sort.AdaptiveSortAlg, order::Base.Order.ForwardOrdering, buffer::SparseVector{Float64, Int64})
   @ Base.Sort ./sort.jl:1352
 [7] sort!(A::SparseMatrixCSC{Float64, Int64}; dims::Int64, alg::Base.Sort.AdaptiveSortAlg, lt::Function, by::Function, rev::Nothing, order::Base.Order.ForwardOrdering, buffer::SparseVector{Float64, Int64})
   @ Base.Sort ./sort.jl:1339
 [8] kwcall(::NamedTuple{(:dims,), Tuple{Int64}}, ::typeof(sort!), A::SparseMatrixCSC{Float64, Int64})
   @ Base.Sort ./sort.jl:1331
 [9] top-level scope
   @ REPL[5]:1

LilithHafner avatar Nov 28 '22 02:11 LilithHafner