Skip to content

Add methods tovsort! and quicksort! to allow argsort#16

Merged
brenhinkeller merged 3 commits intomainfrom
argsort
Nov 15, 2022
Merged

Add methods tovsort! and quicksort! to allow argsort#16
brenhinkeller merged 3 commits intomainfrom
argsort

Conversation

@brenhinkeller
Copy link
Copy Markdown
Collaborator

This PR adds an optional two-argument form of vsort! (and, internally,quicksort!) wherein one may specify an additional array (I) to sort in-place via the same permutation as the array being actively sorted (A).

This may be useful in several contexts. For example, if I is initialized with collect(eachindex(A)), the sorted I will be equal to sortperm(A) for the original A

…ond array to sort; if initizlized with indices, the result will be a permutation vector
@brenhinkeller brenhinkeller merged commit c19f4ba into main Nov 15, 2022
@brenhinkeller brenhinkeller deleted the argsort branch November 15, 2022 15:55
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 this pull request may close these issues.

1 participant