nalgebra icon indicating copy to clipboard operation
nalgebra copied to clipboard

remove unnecessary trait bounds in matrix conversions.

Open taketo1024 opened this issue 2 years ago • 2 comments

Removed some of the unnecessary trait bounds in matrix conversions.

taketo1024 avatar Dec 13 '23 03:12 taketo1024

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 avatar Dec 13 '23 08:12 Andlon

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!

Andlon avatar Dec 13 '23 08:12 Andlon