-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fill! behavior for structurally-constrained storage types? #17670
Comments
Bifurcation sounds good, guess I'd prefer |
There is a |
|
I would reverse the convention: |
|
On the one hand I like this argument. Being explicit ( On the other hand I also like |
A think a good way to address this is to use representations of the relevant indices. For example, instead of having |
For one-liners like @tkelman yeah, breaking that identity would be bad, although I'm not sure using colons on sparse matrices is a good idea at all. I guess the next best thing would be As a general principle, I think the sparse-specific functions should have fallbacks for the dense case to enable generic programming. |
It isn't, but unless it's going to be a method error I think we should keep the existing "linear algebraic" concepts consistent between dense and sparse, as most of the AbstractArray interface tends to be designed around that. New abstractions for storage-dependent behavior should probably be the special cases, and need careful thought to migrate code to use them correctly - somewhat like (otherwise dense) unconventionally-indexed arrays. |
Per triage, the long-term direction should be |
+1 |
See discussion in JuliaLang/julia#17670 for more details
Bumping on this. I just hit it, and from the looks of it it seems other scientific computing groups are hitting it too. It's very non-intuitive for |
Ref. discussion between @martinholters and @tkelman starting at #16740 (comment). How should
fill!
behave for storage types with structural constraints such asBidiagonal
andSparseMatrixCSC
? Brief illustration:In other words, does
fill!
mean 'fill every addressable entry in the providedAbstractArray
', or 'fill every stored entry in the providedAbstractArray
'? Shouldfill!
bifurcate into, e.g.,fillall!
andfillstored!
? Best!The text was updated successfully, but these errors were encountered: