Although argmin/argmax on v0.7+ are defined on anything you can iterate (via findmin/findmax), that's not the case within Compat at the moment. Currently, they are defined for:
AbstractArray
AbstractVector
Associative
Therefore, you can't currently write compatible code if you want to use Tuples:
julia> VERSION
v"0.6.3"
julia> using Compat
julia> argmin((1, 2, 3.0))
ERROR: MethodError: no method matching argmin(::Tuple{Int64,Int64,Int64})
Closest candidates are:
argmin(::AbstractArray{T,1} where T) at /Users/nowacki/.julia/v0.6/Compat/src/Compat.jl:1401
argmin(::AbstractArray) at /Users/nowacki/.julia/v0.6/Compat/src/Compat.jl:1400
argmin(::Associative) at /Users/nowacki/.julia/v0.6/Compat/src/Compat.jl:1402
Works fine with indmin/indmax, of course:
julia> indmin((1, 2, 3.0))
1
Although
argmin/argmaxon v0.7+ are defined on anything you can iterate (viafindmin/findmax), that's not the case within Compat at the moment. Currently, they are defined for:AbstractArrayAbstractVectorAssociativeTherefore, you can't currently write compatible code if you want to use
Tuples:Works fine with
indmin/indmax, of course: