Skip to content

Commit a5e9ac4

Browse files
authored
Change type signature of _checkbuffers and _goodbuffers (#77)
These methods check the assumptions on colptr, rowval and nonzeros and thus should work for all AbstractSparseMatrixCSC. Changing the signature also removes the need for every subtype to implement it. Fixes #9
1 parent 119cd63 commit a5e9ac4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sparsematrix.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ end
7979

8080
size(S::SparseMatrixCSC) = (getfield(S, :m), getfield(S, :n))
8181

82-
_goodbuffers(S::SparseMatrixCSC) = _goodbuffers(size(S)..., getcolptr(S), getrowval(S), nonzeros(S))
83-
_checkbuffers(S::SparseMatrixCSC) = (@assert _goodbuffers(S); S)
82+
_goodbuffers(S::AbstractSparseMatrixCSC) = _goodbuffers(size(S)..., getcolptr(S), getrowval(S), nonzeros(S))
83+
_checkbuffers(S::AbstractSparseMatrixCSC) = (@assert _goodbuffers(S); S)
8484
_checkbuffers(S::Union{Adjoint, Transpose}) = (_checkbuffers(parent(S)); S)
8585

8686
function _goodbuffers(m, n, colptr, rowval, nzval)

0 commit comments

Comments
 (0)