PROCEDURE Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k) ;
VALUE n, m ; ARRAY a ; INTEGER n, m, i, k ; REAL y ;
COMMENT The absolute greatest element of the matrix a, of size n by m
is transferred to y, and the subscripts of this element to i and k ;
BEGIN
INTEGER p, q ;
y := 0 ; i := k := 1 ;
FOR p := 1 STEP 1 UNIT n DO
FOR q := 1 STEP 1 UNTIL m DO
IF abs (a[p, q]) > y THEN
BEGIN
y := abs (a[p, q]) ;
i := p; k := q
END
END Absmax