From e90995c1c251c34debd8eb9e1437eb1567b1a5be Mon Sep 17 00:00:00 2001 From: Justin Willmert Date: Wed, 26 Dec 2018 12:06:30 -0600 Subject: [PATCH] Add indtype and nnz definitions for SparseColumnView --- stdlib/SparseArrays/src/sparsevector.jl | 5 +++++ 1 file changed, 5 insertions(+) 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 #