Function rgsl::sort::objects::heapsort_index

source ·
pub fn heapsort_index<T>(
    p: &mut [usize],
    array: &[T],
    compare: comparison_fn<T>
) -> Value
Expand description

This function indirectly sorts the count elements of the array array, each of size size, into ascending order using the comparison function compare. The resulting permutation is stored in p, an array of length n. The elements of p give the index of the array element which would have been stored in that position if the array had been sorted in place. The first element of p gives the index of the least element in array, and the last element of p gives the index of the greatest element in array. The array itself is not changed.