You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionSparseMatrixCSC{Tv,Ti}(M::StridedMatrix) where {Tv,Ti}
@@ -1340,7 +1340,7 @@ function _sparse_findprevnz(m::SparseMatrixCSC, i::Integer)
1340
1340
end
1341
1341
1342
1342
1343
-
functionsparse_increasing!(I::Vector{Ti}, V::Vector, m::Int, n::Int) where Ti
1343
+
functionsparse_sortedlinearindices!(I::Vector{Ti}, V::Vector, m::Int, n::Int) where Ti
1344
1344
length(I) ==length(V) ||throw(ArgumentError("I and V should have the same length"))
1345
1345
nnz =length(V)
1346
1346
colptr =Vector{Ti}(undef, n +1)
@@ -1353,7 +1353,7 @@ function sparse_increasing!(I::Vector{Ti}, V::Vector, m::Int, n::Int) where Ti
1353
1353
j <= nnz && (I[j] += colm)
1354
1354
colm += m
1355
1355
end
1356
-
SparseMatrixCSC(m, n, colptr, I, V)
1356
+
returnSparseMatrixCSC(m, n, colptr, I, V)
1357
1357
end
1358
1358
1359
1359
"""
@@ -1382,7 +1382,7 @@ function sprand(r::AbstractRNG, m::Integer, n::Integer, density::AbstractFloat,
1382
1382
(m <0|| n <0) &&throw(ArgumentError("invalid Array dimensions"))
1383
1383
0<= density <=1||throw(ArgumentError("$density not in [0,1]"))
1384
1384
I =randsubseq(r, 1:(m*n), density)
1385
-
sparse_increasing!(I, convert(Vector{T}, rfn(r,length(I))), m, n)
1385
+
returnsparse_sortedlinearindices!(I, convert(Vector{T}, rfn(r,length(I))), m, n)
1386
1386
end
1387
1387
1388
1388
sprand(m::Integer, n::Integer, density::AbstractFloat, rfn::Function, ::Type{T}=eltype(rfn(1))) where T =sprand(GLOBAL_RNG,m,n,density,(r, i) ->rfn(i))
0 commit comments