-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
RFC: Add rowval index type to SparseMatrixCSC #39899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
86ade2d
to
dbc23ab
Compare
All the changes you had to do, e.g. |
I see, thanks for clarifying. I had in mind the call to constructors, the assumption that |
dbc23ab
to
2f7da14
Compare
It is possible this could be quite breaking. We should run pkgeval. Also, does it increase compile time noticeably? |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
I checked a few, and the test failures are related to things that match my modification pattern Fredrik pointed out. So I believe these 33- packages (some fail for unknown reasons) could be changed in a way that doesn't require version-checking and alike, and then should work also with previous Julia versions. Is this something we want to consider? |
There is also the cases of, for example, struct X
m::SparseMatrixCSC{Float64,Int}
end that will now be abstractly typed. It seems like a very niche usecase (?) so perhaps it could just live in a package? After #33039 it might not even require much more code than simply struct SparseMatrixCSC2{Tv,Ti<:Integer,Tr<:Integer} <: SparseArrays.AbstractSparseMatrixCSC{Tv,Ti}
m::Int
n::Int
colptr::Vector{Ti}
rowval::Vector{Tr}
nzval::Vector{Tv}
end |
@msekino Could you check if Fredrik's suggestion above works for you? If it can be done without much effort in an extra package (or just as part of your package), then I now agree that this is the way to go, since the cost of adaptation throughout the ecosystem is rather high for such a change here. |
@dkarrasch @fredrikekre |
This allows to have distinct "index types" for the nonzeros on the one hand, and the rowvals on the other hand. In general, this may not be a dramatic reduction in memory usage, but in some cases this may push limits, see #38790.
This should be fully backward compatible, andbasically all existing tests pass up to minor obvious/inavoidable changes.TODO (if we agree to go in this direction):
Closes #38790.