Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong results using argmin or argmax #83

Open
doraut opened this issue Nov 7, 2019 · 0 comments
Open

Wrong results using argmin or argmax #83

doraut opened this issue Nov 7, 2019 · 0 comments

Comments

@doraut
Copy link

doraut commented Nov 7, 2019

Using argmin or argmax along a dimension of an OffsetArray gives wrong results for some offsets
Examples:

using OffsetArrays
A = [1 2; 1 2]
for offset in 0:-1:-3
    A_off = OffsetArray(A, offset, -1)
    A_off[argmin(A_off, dims=2)] |> println
end

produces

[1; ; 1] # Correct
[2; ; 1] # Wrong
[1; ; 2] # Wrong
[1; ; 1] # Correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant