Skip to content

Commit

Permalink
Fix bug in size()
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojukka5 committed Oct 6, 2018
1 parent fa727b8 commit deba570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sparsematrixcoo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SparseMatrixCOO(A::Matrix) = SparseMatrixCOO(sparse(A))
SparseArrays.SparseMatrixCSC(A::SparseMatrixCOO) = sparse(A.I, A.J, A.V)
Base.isempty(A::SparseMatrixCOO) = isempty(A.I) && isempty(A.J) && isempty(A.V)
Base.size(A::SparseMatrixCOO) = isempty(A) ? (0, 0) : (maximum(A.I), maximum(A.J))
Base.size(A::SparseMatrixCOO, idx::Int) = size(A)[i]
Base.size(A::SparseMatrixCOO, idx::Int) = size(A)[idx]
Base.Matrix(A::SparseMatrixCOO) = Matrix(SparseMatrixCSC(A))

get_nonzero_rows(A::SparseMatrixCOO) = unique(A.I[findall(!iszero, A.V)])
Expand Down

0 comments on commit deba570

Please sign in to comment.