|The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....|
|Home MathPack Vector Methods SortElems|
|See also: OnSortExchange, TSortExchgEvent, ShuffleElems|
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 event OnSortExchange is generated whenever two elements have to be exchanged during the sorting process. 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).