Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
abraunst committed Jan 30, 2019
1 parent 3b2494b commit 6b41918
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions stdlib/SparseArrays/src/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

module HigherOrderFns

_goodbuffers(n, colptr, rowval, nzval) = length(colptr) == n + 1 && colptr[end] - 1 == length(rowval) == length(nzval)
_goodbuffers(S::SparseMatrixCSC) = _goodbuffers(S.n, S.colptr, S.rowval, S.nzval)
_checkbuffers(S::SparseMatrixCSC) = (@assert _goodbuffers(S); S)
_checkbuffers(S::SparseVector) = (@assert length(S.nzval) == length(S.nzind); S)

# This module provides higher order functions specialized for sparse arrays,
# particularly map[!]/broadcast[!] for SparseVectors and SparseMatrixCSCs at present.
import Base: map, map!, broadcast, copy, copyto!
Expand Down Expand Up @@ -152,6 +147,9 @@ function _reset!(C::SparseMatrixCSC)
empty!(C.nzval)
end

_checkbuffers(S::SparseMatrixCSC) = (@assert length(colptr) == n + 1 && colptr[end] - 1 == length(rowval) == length(nzval); S)
_checkbuffers(S::SparseVector) = (@assert length(S.nzval) == length(S.nzind); S)

_capacity(A::SparseVecOrMat) = capacity(storedinds(A))

# (2) map[!] entry points
Expand Down

0 comments on commit 6b41918

Please sign in to comment.