From fc65a167414b5ca920b59a17af436766458eb4a6 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Mon, 31 Oct 2022 21:34:43 -0400 Subject: [PATCH] Add size for SparseMatrixCSR and SparseMatrixCOO --- src/mklsparsematrix.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mklsparsematrix.jl b/src/mklsparsematrix.jl index 9072786..c5ddc2f 100644 --- a/src/mklsparsematrix.jl +++ b/src/mklsparsematrix.jl @@ -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)