From 6b419186a6ab70824589c184a666e2697ff7d06c Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Wed, 30 Jan 2019 14:00:24 +0100 Subject: [PATCH] oops --- stdlib/SparseArrays/src/higherorderfns.jl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/stdlib/SparseArrays/src/higherorderfns.jl b/stdlib/SparseArrays/src/higherorderfns.jl index 029f4abd1fcf7..2f303a6659b68 100644 --- a/stdlib/SparseArrays/src/higherorderfns.jl +++ b/stdlib/SparseArrays/src/higherorderfns.jl @@ -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! @@ -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