-
-
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
SparseMatrix Interface #8720
SparseMatrix Interface #8720
Conversation
…e a little friendlier.
|
||
.. function:: rowvals(A) | ||
|
||
Return a vector of the row indices of a sparse matrix ``A``. The returned vector points directly to the internal row indices of ``A``, and any modifications to the returned vector will mutate ``A`` as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description would be pretty confusing to someone not familiar with CSC format. Maybe a bit more context?
No reason not to have convenience functions like these. What I'd really like to see is dense and sparse matrices supporting similar "iterate by columns through nonzero elements" (or by rows for transpose types?) API's, so various operators and reductions can extend efficiently to sparse while reusing generic implementations. |
The iterator would be nice but getting the row index and passing it was slow when I first tried this, and I don't think it would have changed. |
I was thinking about this recently and though that adding an |
How about calling it |
Updated with suggestions. |
Given the history of heated debates on naming (#6769), what's the motivation for renaming |
Oops, I forgot about |
ee4ceab
to
3739991
Compare
Ok, reverted the |
thanks, LGTM |
Add
rowvals(A)
andnzrange(A, col)
to make the sparse matrix interface a little friendlier.cc @ViralBShah, @tanmaykm