julia
julia copied to clipboard
added sortperm(v, alg;....) signature
This is to open the door for specialized algorithms for sortperm e.g. sortperm for Radixsort see https://github.com/JuliaCollections/SortingAlgorithms.jl/pull/25
Why do you need this for sortperm but not for sort? Can't you take the same approach as existing code in SortingAlgorithms does with sort!, i.e. override sortperm!?
@nalimilan sort(v, alg = RadixSort) is already working hence no need to change. But sortperm(v, alg = RadixSort) is really slow as it's still using the sortperm in Base not on a specialized algorithm. Both Base.sortperm and Base.sortperm! reduces to using sort!, which in the case of Radixsort (at least) is not the optimal way to sortperm, as can be shown in my PR to SortingAlgorithms