Skip to content
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

SUNMatScaleAdd Inefficient for Sparse Matrices #590

Open
Steven-Roberts opened this issue Oct 8, 2024 · 0 comments
Open

SUNMatScaleAdd Inefficient for Sparse Matrices #590

Steven-Roberts opened this issue Oct 8, 2024 · 0 comments

Comments

@Steven-Roberts
Copy link
Collaborator

After working on #584, I noticed the sparse implementation of SUNMatScaleAdd has a $O(M N)$ runtime for the same reason identified in #253. Ideally the runtime would be $O(nnz_A + nnz_B)$ (total # of nonzero entries in two matrices being added). This can be attained (or at least close), but this is complicated somewhat by indexptrs not necessarily being sorted for each column (assuming CSC). After reviewing the csparse implementation, on which I think the current algorithm is roughly based, I see two possible approaches to improve SUNMatScaleAdd performance that I can test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant