minval(3I)

MINVAL - Returns the minimum value in an array

As shipped in IRIX 6.5.22. Last changed in IRIX 6.5.19.

NAME
     MINVAL - Returns the minimum value in an array

SYNOPSIS
     MINVAL ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])

STANDARDS
     Fortran

DESCRIPTION
     The MINVAL intrinsic function can be used for array reduction.  It
     returns the minimum value of the elements of array along dimension dim
     corresponding to the true elements of mask.  It accepts the following
     arguments:

     array     Must be of type integer or real.  It must not be scalar.

     dim       Must be a scalar integer value in the range 1 <= dim <= n,
               where n is the rank of array.  The corresponding actual
               argument must not be an optional dummy argument.

     mask      Must be of type logical and must be conformable with array.

     MINVAL is a transformational intrinsic function.  The name of this
     intrinsic cannot be passed as an argument.

RETURN VALUES
     The result is of the same type as array.  It is scalar if dim is
     absent or array has rank one.  Otherwise, the result is an array of
     rank n-1 and of shape
     (d1, d2, ..., ddim-1, ddim+1, ..., dn),

     where (d1, d2, ..., dn)

     is the shape of array.

     The result of MINVAL(array) has a value equal to the minimum value of
     all the elements of array or has the value of the positive number of
     the largest magnitude supported for numbers of the data type of array
     if array is a zero-sized array.

     The result of MINVAL(array,MASK=mask) has a value equal to the minimum
     value of all the elements of array corresponding to true elements of
     mask or has the value of the positive number of the largest magnitude
     supported for numbers of the data type of array if there are no true
     elements.

     If array has rank one, MINVAL(array,dim[,mask]) has a value equal to
     that of MINVAL(array[,MASK=mask]).  Otherwise, the value of element
     (s1, s2, ..., sdim-1, sdim+1, ..., sn)

     of MINVAL(array,dim[,mask]) is equal to
     MINVAL(array(s1, s2, ..., sdim-1, : , sdim+1, ..., sn),

      [, MASK=mask(s1, s2, ..., sdim-1, : , sdim+1, ..., sn)]).


     MINVAL returns the value of +INFINITY for real, zero-sized arrays.  A
     request for interpretation of the Fortran 95 standard may change one
     of these return values for a real array in a future release.

EXAMPLES
     Example 1:  MINVAL((/1,2,3/)) yields 1.

     Example 2:  Assume that C is array [10,-100,10].
     MINVAL(C,MASK=C.LT.0) yields the minimum of the negative elements of
     C, which is -100.  MINVAL(C,MASK=C.GT.10) returns the largest possible
     integer because there are no true elements using the mask.

     Example 3:  Assume that B is the following array:

     | 1 3 5 |
     | 2 4 6 |

     The following are true:

     * MINVAL(B,DIM=1) yields [1,3,5].

     * MINVAL(B,DIM=2) yields [1,2].

     * MINVAL(B) yields 1.

     Example 4:  Assume that N is the following array:

     | 0 1 2 3 |
     | 4 5 6 7 |
     | 8 9 0 1 |

     In an array section reference, the following are true:

     * MINVAL(N(2:3,2:4),MASK=N(2:3,2:4).NE.0) yields 1.

     * MINVAL(N(2:3,2:4),DIM=1,N(2:3,2:4).NE.0) yields [5,6,1].

     * MINVAL(N(2:3,2:4),DIM=2,N(2:3,2:4).NE.0) yields [5,1].