Accept AbstractSparseMatrixCSC for decompression#298
Accept AbstractSparseMatrixCSC for decompression#298blegat wants to merge 9 commits intoJuliaDiff:mainfrom
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
| decompress | ||
| decompress! | ||
| decompress_single_color! | ||
| decompress_csc! |
There was a problem hiding this comment.
The specific result types we use are not public right now, so this function cannot be public either
There was a problem hiding this comment.
It was failing if not included in the docs since it has a docstring.
What do you mean by result types not being public ? decompress! also takes result as argument
There was a problem hiding this comment.
I mean that the precise names and fields of the results which are returned are subject to change.
That's also why I asked whether we wanted to extend decompress_csc! beyond just the acyclic coloring case, because otherwise we have to document that it only works for a specific type of coloring. In any case, I'd rather keep it in the private part of the package and list the docstring among the internals, so that you can start using it but we're free to refine the interface in future versions.
| nzA::AbstractVector{R}, | ||
| A_colptr::AbstractVector, | ||
| B::AbstractMatrix{R}, | ||
| result::TreeSetColoringResult, |
There was a problem hiding this comment.
It seems a bit weird to only add this for the acyclic case, you don't need it for anything else on the JuMP side?
There was a problem hiding this comment.
True, I haven't tested with star coloring yet. That's one of the advantage of using SMC, now we can easily test with star coloring as well :)
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% 95.52%
=======================================
Files 20 20
Lines 2145 2145
=======================================
Hits 2049 2049
Misses 96 96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Here is a suggestion for #296 (comment)
I can write tests if the change sounds reasonable