ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

ndarray::ArrayViewMut::windows should produce mutable windows

Open Chris00 opened this issue 2 years ago • 2 comments

Calling .windows() on an ndarray::ArrayViewMut should return mutable windows. That's very useful when, for example, you iterate over a partition of an interval and the quantities you compute affect values living on both ends of the interval.

Chris00 avatar Feb 05 '24 21:02 Chris00

That's not possible by lifetime rules in Rust - the iterator's elements are simultaneously valid, and since they are windows, they partially overlap, which is not allowed for mutable references.

We'll need to update the issue with a plan for a way to get the intended effect in a way we can implement.

bluss avatar Feb 05 '24 22:02 bluss