Skip to content

Commit

Permalink
use widelength in sizehint! to cope with large matrices in 32 bit sys…
Browse files Browse the repository at this point in the history
…tems
  • Loading branch information
abraunst committed Apr 20, 2021
1 parent 3496fd6 commit 46e110f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/SparseArrays/src/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ similar(S::AbstractSparseMatrixCSC, ::Type{TvNew}, ::Type{TiNew}, m::Integer, n:
_sparsesimilar(S, TvNew, TiNew, (m, n))

function Base.sizehint!(S::SparseMatrixCSC, n::Integer)
nhint = min(n, length(S))
nhint = min(n, widelength(S))
sizehint!(getrowval(S), nhint)
sizehint!(nonzeros(S), nhint)
return S
Expand Down

0 comments on commit 46e110f

Please sign in to comment.