Accept AbstractSparseMatrixCSC for decompression#298
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
- Coverage 99.39% 95.52% -3.87%
==========================================
Files 20 20
Lines 2145 2145
==========================================
- Hits 2132 2049 -83
- Misses 13 96 +83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gdalle
left a comment
There was a problem hiding this comment.
I don't think there are any API specifications on SparseArrays.AbstractSparseMatrixCSC, and since we make heavy use of the fields of SparseMatrixCSC, this seems like a risky move. Can you explain where it comes in handy?
|
Yes, the decompression relies on a few properties of
In my case, the The properties that the implementation relies on are that |
There are CSC matrices in the ecosystem where the sorting is not enforced, see eg JuliaGPU/GPUArrays.jl#648. The question is whether there could be subtypes of Given that uncertainty, I kinda like the suggestion you made in #296 to split out a decompression subroutine that uses an |
|
Reading more the implementation of the decompression, it seemed that it was also using the |
|
I think I'd rather add an internal indirection step like function decompress!(A::SparseMatrixCSC, ...)
return decompress_csc!(A.nzval, A.rowval, A.colptr, A.m, A.n, ...)
endthan rely on an incompletely specified |
6a8ec50 to
a4ed265
Compare
Co-authored-by: Guillaume Dalle <22795598+gdalle@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
+ Coverage 95.52% 99.20% +3.68%
==========================================
Files 20 20
Lines 2145 2145
==========================================
+ Hits 2049 2128 +79
+ Misses 96 17 -79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gdalle
left a comment
There was a problem hiding this comment.
Thanks! Since this only affects private internals, I see no reason to delay it any further. I'll merge and release so that you may experiment with it, then we'll see whether we need to extend what you coded to other result types
Here is a suggestion for #296 (comment)
I can write tests if the change sounds reasonable