sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
394 stars 46 forks source link

outer_iterator_mut does not implement DoubleEndedIterator correctly #261

Closed mulimoen closed 3 years ago

mulimoen commented 3 years ago

outer_iterator_mut uses a successive application of split_at_mut. The iterator is such not double-ended, and will fail when trying to iterate backwards on it. The code for this can be seen at https://github.com/mulimoen/sprs/tree/bug/outer_iterator_mut, see the actions page at https://github.com/mulimoen/sprs/actions/runs/436352486 for the error message.

How to fix: We probably need to sprinkle a bit of unsafe here to be able to move self.data into the closure, and make it independent of iteration order.

vbarrielle commented 3 years ago

Fixed by #263