QS2I1R(3)

SYNOPSIS
SUBROUTINE QS2I1R (IA, JA, A, N, KFLAG)

NAME
qs2i1r - Sort an integer array, moving an integer and real array. This routine sorts the integer array IA and makes the same interchanges in the integer array JA and the real array A. The array IA may be sorted in increasing order or decreas- ing order. A slightly modified QUICKSORT algorithm is used.

LIBRARY
SLATEC (SLAP)

CATEGORY
N6A2A

TYPE
SINGLE PRECISION (QS2I1R-S, QS2I1D-D)

KEYWORDS
SINGLETON QUICKSORT, SLAP, SORT, SORTING

AUTHOR
Jones, R. E., (SNLA) Kahaner, D. K., (NBS) Seager, M. K., (LLNL) seager@llnl.gov Wisniewski, J. A., (SNLA)

DESCRIPTION
Written by Rondall E Jones Modified by John A. Wisniewski to use the Singleton QUICKSORT algorithm. date 18 November 1976. Further modified by David K. Kahaner National Bureau of Standards August, 1981 Even further modification made to bring the code up to the Fortran 77 level and make it more readable and to carry along one integer array and one real array during the sort by Mark K. Seager Lawrence Livermore National Laboratory November, 1987 This routine was adapted from the ISORT routine. ABSTRACT This routine sorts an integer array IA and makes the same interchanges in the integer array JA and the real array A. The array IA may be sorted in increasing order or decreasing order. A slightly modified quicksort algorithm is used. DESCRIPTION OF PARAMETERS IA - Integer array of values to be sorted. JA - Integer array to be carried along. A - Real array to be carried along. N - Number of values in integer array IA to be sorted. KFLAG - Control parameter = 1 means sort IA in INCREASING order. =-1 means sort IA in DECREASING order.

SEE ALSO
SS2Y

REFERENCES
R. C. Singleton, Algorithm 347, An Efficient Algorithm for Sorting With Minimal Storage, Communications ACM 12:3 (1969), pp.185-7.

ROUTINES CALLED
XERMSG

REVISION HISTORY (YYMMDD)
761118 DATE WRITTEN
890125 Previous REVISION DATE
890915 Made changes requested at July 1989 CML Meeting. (MKS)
890922 Numerous changes to prologue to make closer to SLATEC standard. (FNF)
890929 Numerous changes to reduce SP/DP differences. (FNF)
900805 Changed XERROR calls to calls to XERMSG. (RWC)
910411 Prologue converted to Version 4.0 format. (BAB)
910506 Made subsidiary to SS2Y and corrected reference. (FNF)
920511 Added complete declaration section. (WRB)
920929 Corrected format of reference. (FNF)
921012 Added E0's to f.p. constants. (FNF)