From 46e110fb75f63b83ed7dec768349a67d6a46826c Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Mon, 19 Apr 2021 09:21:06 +0200 Subject: [PATCH] use widelength in sizehint! to cope with large matrices in 32 bit systems --- stdlib/SparseArrays/src/sparsematrix.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index a1ded144ea3791..9ca3a60dc521f4 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -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