`findmax` and friends: confusing behaviour to be introduced in 1.7

As I understand it argmax(f,A) as defined in nightly is just the mathematical definition. Is this wrong? The reason 1 arg argmax was brought up is that since the 2 arg version is mathematically correct, if there is inconsistency, it would be the 1 arg version that’s inconsistent.

The reason argmax(identity, A) != argmax(A) is true is because in cases where you want this behavior from argmax(A) you can just use maximum instead, and it is conceptually really useful in many cases to interpret an Array as a function who’s range is the values, and who’s domain is the indices. One possible solution for Julia 2.0 is to deprecate argmax(A) since it has 2 somewhat contradictory interpretations, and both of them can be written relatively simply in ways that avoid the confusion.

1 Like