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

remove unnecessary trait bounds in matrix conversions. #1331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taketo1024
Copy link

Removed some of the unnecessary trait bounds in matrix conversions.

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, but I'll let someone who has some idea about sparse matrices verify.

@Andlon
Copy link
Collaborator

Andlon commented Dec 13, 2023

I was surprised to see that we can remove ClosedAdd from COO->CSR conversion, since if there are duplicates in the COO format, we add them together. Digging a little into it, I see that convert_coo_cs, which convert_coo_csr calls, somehow calls combine_duplicates with std::ops::Add::add, yet it has no bounds for Add. I'm perplexed - what am I missing here?

@Andlon
Copy link
Collaborator

Andlon commented Dec 13, 2023

Ah, num_traits::Zero requires Add. That is uh, not so obvious IMO. Well, in any case, we can remove these bounds. But since we try to provide the same API for CsrMatrix and CscMatrix, can you please add the same changes to CscMatrix @taketo1024? That would be great!

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

Successfully merging this pull request may close these issues.

3 participants