diff --git a/stdlib/SparseArrays/src/sparsevector.jl b/stdlib/SparseArrays/src/sparsevector.jl index ecf3c53830b301..11d9c2a3dbdbe0 100644 --- a/stdlib/SparseArrays/src/sparsevector.jl +++ b/stdlib/SparseArrays/src/sparsevector.jl @@ -58,6 +58,11 @@ function nonzeroinds(x::SparseColumnView) return y end +indtype(x::SparseColumnView) = indtype(parent(x)) +function nnz(x::SparseColumnView) + rowidx, colidx = parentindices(x) + return length(nzrange(parent(x), colidx)) +end ## similar #