Skip to content

Commit

Permalink
Fix argmin and argmax
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle authored May 10, 2024
1 parent fa840f9 commit 0ba1041
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chainedvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,10 @@ end

Base.findmax(x::ChainedVector) = findmax(identity, x)
Base.findmin(x::ChainedVector) = findmin(identity, x)
Base.argmax(x::ChainedVector) = findmax(identity, x)[1]
Base.argmin(x::ChainedVector) = findmin(identity, x)[1]
Base.argmax(f::F, x::ChainedVector) where {F} = x[findmax(f, x)[2]]
Base.argmin(f::F, x::ChainedVector) where {F} = x[findmin(f, x)[2]]
Base.argmax(x::ChainedVector) = findmax(identity, x)[2]
Base.argmin(x::ChainedVector) = findmin(identity, x)[2]
Base.argmax(f::F, x::ChainedVector) where {F} = findmax(f, x)[2]
Base.argmin(f::F, x::ChainedVector) where {F} = findmin(f, x)[2]

function Base.findfirst(f::Function, x::ChainedVector)
prevind = 0
Expand Down

0 comments on commit 0ba1041

Please sign in to comment.