From bf83a7c74b99555be2868857f0c775666c22fc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Fuhrmann?= Date: Thu, 1 Jun 2023 14:06:27 +0200 Subject: [PATCH] Remove inconsistent methods which are supposed to return a SparseMatrixCSC, but would not. See https://github.com/JuliaSparse/SparseArrays.jl/issues/265#issuecomment-1438645148 --- src/sparsematrix.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sparsematrix.jl b/src/sparsematrix.jl index fe6fbe43..1b76a372 100644 --- a/src/sparsematrix.jl +++ b/src/sparsematrix.jl @@ -750,11 +750,11 @@ function Base.sizehint!(S::SparseMatrixCSC, n::Integer) end # converting between SparseMatrixCSC types -SparseMatrixCSC(S::AbstractSparseMatrixCSC) = copy(S) + AbstractMatrix{Tv}(A::AbstractSparseMatrixCSC) where {Tv} = SparseMatrixCSC{Tv}(A) SparseMatrixCSC{Tv}(S::AbstractSparseMatrixCSC{Tv}) where {Tv} = copy(S) SparseMatrixCSC{Tv}(S::AbstractSparseMatrixCSC) where {Tv} = SparseMatrixCSC{Tv,eltype(getcolptr(S))}(S) -SparseMatrixCSC{Tv,Ti}(S::AbstractSparseMatrixCSC{Tv,Ti}) where {Tv,Ti} = copy(S) + function SparseMatrixCSC{Tv,Ti}(S::AbstractSparseMatrixCSC) where {Tv,Ti} eltypeTicolptr = Vector{Ti}(getcolptr(S)) eltypeTirowval = Vector{Ti}(rowvals(S))