SentinelArrays.jl
SentinelArrays.jl copied to clipboard
`argmax` returns incorrect results
This package incorrectly implements argmax for ChainedVectors. It returns the maximum value, rather than its index.
julia> using SentinelArrays
julia> arrays = [
[18, 70, 92, 15, 65],
[25, 14, 95, 54, 57]
];
julia> cv = ChainedVector(arrays);
julia> argmax(cv)
95
julia> argmax(collect(cv))
8
The implementation is here and is tested, though the test only tests a simple special case for which the values and indices are exactly equal.
This issue was initially reported upstream.