@@ -680,12 +680,12 @@ sort(v::AbstractVector; kws...) = sort!(copymutable(v); kws...)
680680
681681Return a partial permutation of the vector `v`, according to the order specified by
682682`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+ the index in `v` of the value which would be sorted at position `k` is returned;
685+ if `k` is a range, an array with the indices in `v` of the values which would be sorted in
686+ these positions is returned.
687+
688+ Note that this is equivalent to, but more efficient than, calling `sortperm(...)[k]`.
689689"""
690690partialsortperm (v:: AbstractVector , k:: Union{Integer,OrdinalRange} ; kwargs... ) =
691691 partialsortperm! (similar (Vector{eltype (k)}, indices (v,1 )), v, k; kwargs... , initialized= false )
@@ -694,7 +694,7 @@ partialsortperm(v::AbstractVector, k::Union{Integer,OrdinalRange}; kwargs...) =
694694 partialsortperm!(ix, v, k, [alg=<algorithm>,] [by=<transform>,] [lt=<comparison>,] [rev=false,] [initialized=false])
695695
696696Like [`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)`.
697+ (the default), `ix` is initialized to contain the values `1:length(ix)`.
698698"""
699699function partialsortperm! (ix:: AbstractVector{<:Integer} , v:: AbstractVector ,
700700 k:: Union{Int, OrdinalRange} ;
0 commit comments