Matrix Row / column wise min/max
sinhrks opened this issue · comments
It is convenient if we have row / column-wise .min
and .max
of Matrix
.
- accept
Axes
to specify axis like other aggregation funcs. - min / max logic should be the same as
argmin / argmax
. (thus requiresPartialEq
)
Excuse part of my above comment - we can add this to the BaseMatrix
trait by adding a where
clause to the function which requires T: PartialEq
.
In which case I think this is a solid addition and I would welcome a PR. If you want to work on this feel free to implement the function without column iterators for now. We should use the Axis
enum to keep things tidy.
Also note that - for the sake of performance - the column-wise min/max is probably better implemented by using the row iterator and folding the rows by accumulating min/max values for each column entry in the row into a vector, rather than using column iterators. This because it's likely far more cache-friendly.
That said, measure first and all that.