We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 287c6c6 commit e530f2fCopy full SHA for e530f2f
src/sparsevector.jl
@@ -1064,6 +1064,14 @@ function Vector(x::AbstractSparseVector{Tv}) where Tv
1064
return r
1065
end
1066
Array(x::AbstractSparseVector) = Vector(x)
1067
+
1068
+function Base.collect(x::Union{AbstractSparseVector,AbstractSparseMatrix})
1069
+ if Base.has_offset_axes(x)
1070
+ return Base._collect_indices(axes(x), x)
1071
+ else
1072
+ return Array(x)
1073
+ end
1074
+end
1075
1076
Base.iszero(x::AbstractSparseVector) = iszero(nonzeros(x))
1077
0 commit comments