Skip to content

Commit

Permalink
Add size for SparseMatrixCSR and SparseMatrixCOO
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Nov 10, 2022
1 parent f9fbbd3 commit 81c4201
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mklsparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ mutable struct SparseMatrixCSR{Tv,Ti} <: AbstractSparseMatrix{Tv,Ti}
nzval::Vector{Tv}
end

Base.size(A::MKLSparse.SparseMatrixCOO) = (A.m, A.n)
Base.size(A::MKLSparse.SparseMatrixCSR) = (A.m, A.n)

SparseArrays.nnz(A::MKLSparse.SparseMatrixCOO) = length(A.vals)
SparseArrays.nnz(A::MKLSparse.SparseMatrixCSR) = length(A.nzval)

Expand Down

0 comments on commit 81c4201

Please sign in to comment.