rust-ndarray / ndarray-stats

Statistical routines for ndarray
https://docs.rs/ndarray-stats
Apache License 2.0
201 stars 25 forks source link

Clarify which (arg)min/max index/value is returned #32

Closed jturner314 closed 5 years ago

jturner314 commented 5 years ago

For performance, it's beneficial to avoid guaranteeing a particular iteration order. For example, the current implementation of min may return any of the minima because the iteration order of ArrayBase.fold() is unspecified. The current implementation of argmin does always return the first minimum (in logical order) since ArrayBase.indexed_iter() always iterates in logical order, but we may want to optimize the iteration order in the future.

LukeMathWalker commented 5 years ago

I agree it makes sense to relax the guarantees we provide.

LukeMathWalker commented 5 years ago

I'll merge :+1: