Next:
HPF_ALIGNMENT(ALIGNEELB, UB, Up: Specifications of Library Previous: GRADE_DOWN(ARRAYDIM)

GRADE_UP(ARRAY,DIM)

Optional Argument. DIM
Description. Produces a permutation of the indices of an array, sorted by ascending array element values.
Class. Transformational function.
Arguments.

ARRAY must be of type integer, real, or character.

DIM (optional) must be scalar and of type integer with a value in the range , where is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.
Result Type, Type Parameter, and Shape. The result is of type default integer. If DIM is present, the result has the same shape as ARRAY. If DIM is absent, the result has shape (/ SIZE(SHAPE(ARRAY)), PRODUCT(SHAPE(ARRAY)) /).
Result Value.
*

(i): The result of S = GRADE_UP(ARRAY) has the property that if one computes the rank-one array B of size PRODUCT(SHAPE(ARRAY)) by FORALL (K=1:SIZE(B,1)) B(K)=ARRAY(S(1,K),S(2,K),...,S(N,K)) where N has the value SIZE(SHAPE(ARRAY)), then B is sorted in ascending order; moreover, all of the columns of S are distinct, that is, if then ALL(S(:,) .EQ. S(:,)) will be false. The sort is stable; if and B() B(), then ARRAY(S(),S(),...,S()) precedes ARRAY(S(),S(),...,S()) in the array element ordering of ARRAY.

(ii): The result of R = GRADE_UP(ARRAY,DIM=K) has the property that if one computes the array B() = ARRAY( R() ) then for all , the vector B() is sorted in ascending order; moreover, R() is a permutation of all the integers in the range LBOUND(ARRAY,K):UBOUND(ARRAY,K). The sort is stable; that is, if and B() B(), then R() R().
Examples.
*

(i): GRADE_UP( (/30, 20, 30, 40, -10/) ) is a rank two array of shape , 1, 5 ,, plus 1filll -1; 1, 5 ,; plus 1filll -1: 1, 5 ,: plus 1filll -1. 1, 5 ,. plus 1filll -1 1, 5 , plus 1filll-1 with the value , 5, 2, 1, 3, 4 ,, plus 1filll -1; 5, 2, 1, 3, 4 ,; plus 1filll -1: 5, 2, 1, 3, 4 ,: plus 1filll -1. 5, 2, 1, 3, 4 ,. plus 1filll -1 5, 2, 1, 3, 4 , plus 1filll-1. (To produce a rank-one result, the optional DIM = 1 argument must be used.)

If A is the array , 1, 9, 2 4, 5, 2 1, 2, 4 ,, plus 1filll -1; 1, 9, 2 4, 5, 2 1, 2, 4 ,; plus 1filll -1: 1, 9, 2 4, 5, 2 1, 2, 4 ,: plus 1filll -1.plus 1filll 1, 9, 2 4, 5, 2 1, 2, 4 ,.-50 1, 9, 2 4, 5, 2 1, 2, 4 , plus 1filll-1, then GRADE_UP(A) has the value , 1, 3, 3, 1, 2, 2, 3, 2, 1 1, 1, 2, 3, 3, 1, 3, 2, 2 ,, plus 1filll -1; 1, 3, 3, 1, 2, 2, 3, 2, 1 1, 1, 2, 3, 3, 1, 3, 2, 2 ,; plus 1filll -1: 1, 3, 3, 1, 2, 2, 3, 2, 1 1, 1, 2, 3, 3, 1, 3, 2, 2 ,: plus 1filll -1.plus 1filll 1, 3, 3, 1, 2, 2, 3, 2, 1 1, 1, 2, 3, 3, 1, 3, 2, 2 ,.-50 1, 3, 3, 1, 2, 2, 3, 2, 1 1, 1, 2, 3, 3, 1, 3, 2, 2 , plus 1filll-1.

(ii): If A is the array , 1, 9, 2 4, 5, 2 1, 2, 4 ,, plus 1filll -1; 1, 9, 2 4, 5, 2 1, 2, 4 ,; plus 1filll -1: 1, 9, 2 4, 5, 2 1, 2, 4 ,: plus 1filll -1.plus 1filll 1, 9, 2 4, 5, 2 1, 2, 4 ,.-50 1, 9, 2 4, 5, 2 1, 2, 4 , plus 1filll-1, then GRADE_UP(A, DIM = 1) has the value , 1, 3, 1 3, 2, 2 2, 1, 3 ,, plus 1filll -1; 1, 3, 1 3, 2, 2 2, 1, 3 ,; plus 1filll -1: 1, 3, 1 3, 2, 2 2, 1, 3 ,: plus 1filll -1.plus 1filll 1, 3, 1 3, 2, 2 2, 1, 3 ,.-50 1, 3, 1 3, 2, 2 2, 1, 3 , plus 1filll-1.




Next:
HPF_ALIGNMENT(ALIGNEELB, UB, Up: Specifications of Library Previous: GRADE_DOWN(ARRAYDIM)


paula@erc.msstate.edu
Thu Dec 8 16:17:11 CST 1994