@@ -51,16 +51,16 @@ Base.similar(Mat::M) where {M<:AbstractGPUSparseMatrixCSC} = M(copy(SparseArrays
5151Base. similar (Vec:: V , T:: Type ) where {Tv, Ti, V<: AbstractGPUSparseVector{Tv, Ti} } = sparse_array_type (V){T, Ti}(copy (SparseArrays. nonzeroinds (Vec)), similar (SparseArrays. nonzeros (Vec), T), length (Vec))
5252Base. similar (Mat:: M , T:: Type ) where {M<: AbstractGPUSparseMatrixCSC } = sparse_array_type (M)(copy (SparseArrays. getcolptr (Mat)), copy (SparseArrays. rowvals (Mat)), similar (SparseArrays. nonzeros (Mat), T), size (Mat))
5353
54- dense_array_type (sa:: SparseVector ) = SparseVector
55- dense_array_type (:: Type{SparseVector} ) = SparseVector
56- sparse_array_type (sa:: SparseVector ) = SparseVector
57- dense_vector_type (sa:: AbstractSparseArray ) = Vector
58- dense_vector_type (sa:: AbstractArray ) = Vector
54+ dense_array_type (a:: AbstractArray ) = dense_array_type (typeof (a))
55+ sparse_array_type (a:: AbstractArray ) = sparse_array_type (typeof (a))
56+ dense_vector_type (a:: AbstractArray ) = dense_vector_type (typeof (a))
57+
58+ dense_array_type (:: Type{<:SparseVector} ) = SparseVector
59+ sparse_array_type (:: Type{<:SparseVector} ) = SparseVector
5960dense_vector_type (:: Type{<:AbstractSparseArray} ) = Vector
6061dense_vector_type (:: Type{<:AbstractArray} ) = Vector
61- dense_array_type (sa:: SparseMatrixCSC ) = SparseMatrixCSC
62- dense_array_type (:: Type{SparseMatrixCSC} ) = SparseMatrixCSC
63- sparse_array_type (sa:: SparseMatrixCSC ) = SparseMatrixCSC
62+ dense_array_type (:: Type{<:SparseMatrixCSC} ) = SparseMatrixCSC
63+ sparse_array_type (:: Type{<:SparseMatrixCSC} ) = SparseMatrixCSC
6464
6565function sparse_array_type (sa:: AbstractGPUSparseArray ) end
6666function dense_array_type (sa:: AbstractGPUSparseArray ) end
0 commit comments