HP MLIB User's Guide Vol. 2 7th Ed.
620 HP MLIB User’s Guide
SSORT/DSORT/ISORT Sort array
Name SSORT/DSORT/ISORT
Sort array
Purpose These subprograms use a quicksort algorithm to sort elements of a vector into
ascending or descending algebraic order. The vector may be stored in a
one-dimensional array or in either a row or a column of a two-dimensional
array.
Usage VECLIB:
CHARACTER*(*) order
INTEGER*4 n, incx
REAL*4 x(lenx)
CALL SSORT(order, n, x, incx)
CHARACTER*(*) order
INTEGER*4 n, incx
REAL*8 x(lenx)
CALL DSORT(order, n, x, incx)
CHARACTER*(*) order
INTEGER*4 n, incx, x(lenx)
CALL ISORT(order, n, x, incx)
VECLIB8:
CHARACTER*(*) order
INTEGER*8 n, incx
REAL*4 x(lenx)
CALL SSORT(order, n, x, incx)
CHARACTER*(*) order
INTEGER*8 n, incx
REAL*8 x(lenx)
CALL DSORT(order, n, x, incx)
CHARACTER*(*) order
INTEGER*8 n, incx, x(lenx)
CALL ISORT(order, n, x, incx)
Input order Sort order option:
’A’ or ’a’ Sort the elements of x into ascending
algebraic order.
’D’ or ’d’ Sort the elements of x into descending
algebraic order.