Sorting Functions

sort(v) Returns a vector with the values from v sorted in ascending order.

reverse(A) Reverses the order of elements in a vector, or the order of rows in a matrix A.

csort(A, n) Returns an array formed by rearranging rows of A until column n is in ascending order.

rsort(A, n) Returns an array formed by rearranging columns of A until row n is in ascending order.

These function use a heapsort algorithm (Press, et. al, Numerical Recipes). The heapsort procedure is not a stable sort, meaning that if you sort values with repeated elements, they appear in an arbitrary order.

Arguments:

Notes:

QuickSheet