-
Notifications
You must be signed in to change notification settings - Fork 53
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
SparseArrays: export nonzeroinds for sparse vectors and sparse column views #40
Comments
It might be worth simultaneously executing on the exported-API nomenclature shift from |
If this is done I would advocate it should be in a slightly more descriptive manner. Such that there is also something for SparseMatrixCSC and potentially per JuliaLang/julia#31329 SparseMatrixCSR. An interface that got directly at the column pointers would be great as well. |
@Sacha0 for matrices I think that we should also make sure that the methods are representative of the stored structures. So For vectors what about |
@Sacha0 So you are saying new functions |
IMHO for That means: replace That would allow to handle Union{SparseVector,SparseMatrixCSC} uniformly. |
It seems to me that Julia has been trying to move towards semantic correctness. While it is semantically correct to ask for the If you want an orientation agnostic method lets try to name it so. |
I can't find the relevant discussions immediately --- if someone has the bandwidth to do the necessary issue tracker spelunking, that would be great! --- so in brief I'll reiterate the motivations for moving towards
Hence |
@Sacha0 this vision of a general, concise, and consistent sparse object has my full support. I proposed the (as I know now) legacy interface I also find it necessary to make a difference between the field names (which should not be used by the user at all), and the accessor methods which could be named There should typically be no need to access the fields directly. All sparse or wrapped sparse types supporting this interface could make use of the standard column-wise (for CSR row-wise) processing loop:
|
@Sacha0 I couldn't agree with this more:
To take it further, beyond using the same data structure for matrix and vectors (you are only saving 3 Int), it strikes me that without much difficulty you could also use the same data structure for uncompressed sparse where you leave room in a given"column" to insert more rows. |
As far as I know, we currently export access to nonzero values to sparse vectors and sparse column views, via
SparseArrays.nonzeros
. However, the correspondingSparseArrays.nonzeroinds
is not exported, which makes these two methods ofSparseArrays.nonzeros
quite useless.I think we should just write docs and export it: Users of sparse vectors / sparse column views are likely to rely on
SparseArrays.nonzeroinds
already, and would already be affected by any reorganization.The text was updated successfully, but these errors were encountered: