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

sortperm! does not allow index vector to be a SubArray #10491

Closed
denizyuret opened this issue Mar 12, 2015 · 1 comment · Fixed by #10496
Closed

sortperm! does not allow index vector to be a SubArray #10491

denizyuret opened this issue Mar 12, 2015 · 1 comment · Fixed by #10496

Comments

@denizyuret
Copy link
Contributor

As far as I can tell there is no reason for this:

function sortperm!{I<:Integer}(x::Vector{I}, v::AbstractVector; alg::Algorithm=DEFAULT_UNSTABLE,

and changing the type of the first argument to AbstractVector fixes it.

Use case: allocate x and v once, and keep using their SubArrays in an algorithm where the array size changes every iteration.

@jakebolewski
Copy link
Member

closed by #10496. Thanks @denizyuret!

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.

2 participants