idllib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

analysis/

mg_sort.pro


An alternative to IDL's SORT function that employs a radix-sort algorithm. This algorithm is stable but slower than the quicksort algorithm used in IDL's SORT function.

Author information

History

Derived from code by Atle Borsholm, VIS, 2012

Routines

result = mg_sort_strings(data)

Handle special case of sorting string arrays.

result = mg_sort(data [, radix=int])

Radix sort input data.

Routine details

top source mg_sort_strings

result = mg_sort_strings(data)

Handle special case of sorting string arrays.

Note that this is very slow compared to SORT in most cases. However, it is a stable sort.

Return value

lonarr(n_elements(data))

Parameters

data in required type=strarr

array of strings to sort

top source mg_sort

result = mg_sort(data [, radix=int])

Radix sort input data.

Return value

lonarr(n_elements(data))

Parameters

data in required type=int, long, float, double, or string array

data to sort

Keywords

radix in optional type=int default=256

radix to use for sort

File attributes

Modification date: Fri Apr 27 14:10:10 2012
Lines: 114
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.