moocow-the-bovine / PDL-CCS

PDL::CCS - Sparse N-dimensional PDLs (migrated from SVN repo)
3 stars 1 forks source link

ccs_accum_nbad type mismatch #6

Open moocow-the-bovine opened 2 years ago

moocow-the-bovine commented 2 years ago

see https://github.com/moocow-the-bovine/PDL-CCS/pull/5#issuecomment-1100614446

mohawk2 commented 2 years ago

Thank you for your extremely thorough attention to this fascinating, subtle problem!

For the high-level PDL::CCS::Nd wrappers, I think it's always the case that NNzOut==NnzIn, so it doesn't make sense there. I can imagine cases with structured data where it does make sense though, and it could be wasteful (especially for ufuncs) to force NNzOut==NnzIn there, so I'm inclined to leave those dimensions distinct.

My recommendations are based on what I've learned from investigating this, and also from my recent experience of using a lot of RedoDimsCode in PDL::LinearAlgebra so I could just pass in null instead of the agonising nonsense with zeroes. They are (I removed the ones you've indicated above since you obviously know your library better than I!):

I believe with those points, you could heavily reduce the PMCode (though not eliminate thanks to the slicing requirement).

moocow-the-bovine commented 2 years ago

... leaving this issue open for now, although I may copy+paste your suggestions (for which many thanks, in particular for the linked examples!) into separate issues later.

mohawk2 commented 4 hours ago

Switching the minimum PDL 2.081, as discussed on #13, will allow using indx where appropriate, which will solve the type mismatch issue.