Function: RANKID
Purpose: Indexes an integer array in descending order.
Category: MATH
File: rank.c
Author: K.G. Begeman
Use: CALL RANKID( ARRIN , Input INTEGER ARRAY
INDX , Output INTEGER ARRAY
N ) Input INTEGER
ARRIN Array to be indexed.
INDX Sorted index.
N Number of elements in ARRIN and INDX.
Description: RANKID indexes an array ARRIN of length N, i.e. outputs
the array INDX such that ARRIN(INDX(J)+1) is in
descending order for J = 1, 2, ..., N. The input
quantities N and ARRIN are not changed. The heapsort
algorithm is used.
Updates: May 15, 1990: KGB, Document created.