@@ -680,12 +680,10 @@ sort(v::AbstractVector; kws...) = sort!(copymutable(v); kws...)
680
680
681
681
Return a partial permutation of the vector `v`, according to the order specified by
682
682
`by`, `lt` and `rev`, so that `v[output]` returns the first `k` (or range of adjacent values
683
- if `k` is a range) values of a fully sorted version of `v`. If `k` is a single index
684
- (Integer), an array of the first `k` indices is returned; if `k` is a range, an array of
685
- those indices is returned. Note that the handling of integer values for `k` is different
686
- from [`select`](@ref) in that it returns a vector of `k` elements instead of just the `k` th
687
- element. Also note that this is equivalent to, but more efficient than, calling
688
- `sortperm(...)[k]`.
683
+ if `k` is a range) values of a fully sorted version of `v`. If `k` is a single index,
684
+ that value is returned; if `k` is a range, an array of values at those indices is returned.
685
+
686
+ Note that this is equivalent to, but more efficient than, calling `sortperm(...)[k]`.
689
687
"""
690
688
partialsortperm (v:: AbstractVector , k:: Union{Integer,OrdinalRange} ; kwargs... ) =
691
689
partialsortperm! (similar (Vector{eltype (k)}, indices (v,1 )), v, k; kwargs... , initialized= false )
@@ -694,7 +692,7 @@ partialsortperm(v::AbstractVector, k::Union{Integer,OrdinalRange}; kwargs...) =
694
692
partialsortperm!(ix, v, k, [alg=<algorithm>,] [by=<transform>,] [lt=<comparison>,] [rev=false,] [initialized=false])
695
693
696
694
Like [`partialsortperm`](@ref), but accepts a preallocated index vector `ix`. If `initialized` is `false`
697
- (the default), ix is initialized to contain the values `1:length(ix)`.
695
+ (the default), `ix` is initialized to contain the values `1:length(ix)`.
698
696
"""
699
697
function partialsortperm! (ix:: AbstractVector{<:Integer} , v:: AbstractVector ,
700
698
k:: Union{Int, OrdinalRange} ;
0 commit comments