next up previous index
Next: E103 Largest Absolute Up: CERNLIB Previous: E100 Polynomial Interpolation

E102 Maximum and Minimum Elements of Arrays

Routine ID: E102
Author(s): K.S. Kölbig, H. LippsLibrary: MATHLIB
Submitter: Submitted: 29.08.1968
Language: FortranRevised: 01.12.1994

Function subprograms MAXIZE, MAXRZE, MAXDFZ and MINIZE, MINRZE, MINDFZ give give the positions of the maximum and minimum elements of a one-dimensional array.

On CDC and Cray computers, the double-precision versions MAXDZE and MINDZE are not available.

Structure:

FUNCTION subprograms
User Entry Names: MAXIZE, MAXRZE, MAXDZE, MINIZE, MINRZE, MINDZE
Obsolete User Entry Names: MAXFZE MAXRZE, MINFZE MINRZE

Usage:

In any arithmetic expression, for t=I (type INTEGER), t=R (type REAL), t=D

(type DOUBLE PRECISION), MAXtZE(A(J),N) and MINtZE(A(J),N)

has the INTEGER value of the location of, respectively, the maximum and minimum elements of the N successive elements of the array A, relative to the element A(J), where A is of type t.

Notes:

  1. If there is more than one location at which the maximum or minimum is attained, the first location is returned as the function value in each case.
  2. If N < 1 the function value is 1.
  3. Clearly, N+J should not exceed the dimension of the array A.
  4. The obsolete older entries MAXFZE (for MAXRZE) and MINFZE (for MINRZE) are kept for a transitional period. They will eventually disappear.

E103


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995