ISORT(3)

SYNOPSIS
SUBROUTINE ISORT (IX, IY, N, KFLAG)

NAME
isort - Sort an array and optionally make the same interchanges in an auxiliary array. The array may be sorted in increasing or decreasing order. A slightly modified QUICKSORT algorithm is used.

LIBRARY
SLATEC

CATEGORY
N6A2A

TYPE
INTEGER (SSORT-S, DSORT-D, ISORT-I)

KEYWORDS
SINGLETON QUICKSORT, SORT, SORTING

AUTHOR
Jones, R. E., (SNLA) Kahaner, D. K., (NBS) Wisniewski, J. A., (SNLA)

DESCRIPTION
ISORT sorts array IX and optionally makes the same interchanges in array IY. The array IX may be sorted in increasing order or decreasing order. A slightly modified quicksort algorithm is used. Description of Parameters IX - integer array of values to be sorted IY - integer array to be (optionally) carried along N - number of values in integer array IX to be sorted KFLAG - control parameter = 2 means sort IX in increasing order and carry IY along. = 1 means sort IX in increasing order (ignoring IY) = -1 means sort IX in decreasing order (ignoring IY) = -2 means sort IX in decreasing order and carry IY along.

REFERENCES
R. C. Singleton, Algorithm 347, An efficient algorithm for sorting with minimal storage, Communications of the ACM, 12, 3 (1969), pp. 185-187.

ROUTINES CALLED
XERMSG

REVISION HISTORY (YYMMDD)
761118 DATE WRITTEN
810801 Modified by David K. Kahaner.
890531 Changed all specific intrinsics to generic. (WRB)
890831 Modified array declarations. (WRB)
891009 Removed unreferenced statement labels. (WRB)
891009 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
901012 Declared all variables; changed X,Y to IX,IY. (M. McClain)
920501 Reformatted the REFERENCES section. (DWL, WRB)
920519 Clarified error messages. (DWL)
920801 Declarations section rebuilt and code restructured to use IF-THEN-ELSE-ENDIF. (RWC, WRB)