The method SortElems provides a means to sort the elements of a vector or part of it. The vector is sorted within the range RangeFirst and RangeLast. The values outside this range are not affected. If both RangeFirst and RangeLast are set to zero values the entire vector is sorted. The parameter Ascending specifies whether the valus are to be sorted in ascending (TRUE) or descending (FALSE) order.
The sorting is performed by a modified bubble sort (CombSort), which has been reported to be comparable in speed to QuickSort (see also R.Box, S. Lacey, BYTE magazine, April 1991).