-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
median changes original array #17153
Comments
@simonbyrne help please |
definitely wrong. I'll fix it |
Looks like an unintended consequence of #16260, which changed |
Thanks @simonster, I've updated the NEWS.md file. |
More likely, we should revert that. I don't even remember doing that intentionally. |
I don't see what's wrong with the change to |
Thanks, all. This fixes a very subtle bug that was causing Distributions tests to fail. |
@simonbyrne It might be faster sometimes but it probably won't be faster all the time. If you're mapping rows, then the resulting views may be slow if you're repeatedly accessing elements, because the elements won't be contiguous in memory. It's possible that a better general approach would be to construct a single array corresponding to the size of the region, then copy into it and reuse it for all invocations of the mapped function. That would still be breaking, but it would probably break less. |
It is often the allocation and subsequent GC that slows things down, not necessarily the data copies. |
Due to a change in the behaviour of `mapslices` (JuliaLang#16260), `median(X,k)` would mutate the underlying array. Fixes JuliaLang#17153.
…17164) * Add test for Issue JuliaLang#17153 and PR JuliaLang#17154 * Fix whitespaces
Notice that
a
has now changed.versioninfo()
:The text was updated successfully, but these errors were encountered: