GSL::Vector#heapsort
GSL::Vector::Complex#heapsort
GSL.heapsort(v)
These method sort the elements of the vector self using the comparison function given by a block, and return the result as a new vector object. The vector self is not changed.
Example: Sorting a complex vector in ascending order by magnitudes.
p v.heapsort { |a, b| a.abs <=> b.abs }
GSL::Vector#heapsort!
GSL::Vector::Complex#heapsort!
GSL.heapsort!(v)
GSL::Vector#heapsort_index
GSL::Vector::Complex#heapsort_index
GSL.heapsort_index(v)
GSL::Vector#sort!
GSL::Vector#sort
GSL::Vector#sort_index
GSL::Permutation
object.
The elements of the returned permutation give the index of the vector
element which would
have been stored in that position if the vector had been sorted in place.
The first element of the permutation gives the index of the least element
in self, and the last element of the permutation gives the index
of the greatest element in
self. The vector self is not changed.GSL::Vector#sort_smallest(k)
GSL::Vector#sort_largest(k)
GSL::Vector#sort_smallest_index(k)
GSL::Vector#sort_largest_index(k)
GSL::Permutation
object of the indices of the
k smallest or largest elements of the vector self.
k must be less than or equal to the length of the vector.