amax(3F)

ISAMAX, IDAMAX, ICAMAX, IZAMAX - Searches a vector for the first occurrence of the maximum absolute value

Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.

NAME
     ISAMAX, IDAMAX, ICAMAX, IZAMAX - Searches a vector for the first
     occurrence of the maximum absolute value

SYNOPSIS
     Real

        index = ISAMAX (n, x, incx)

     Double precision

        index = IDAMAX (n, x, incx)

     Complex

        index = ICAMAX (n, x, incx)

     Double complex

        index = IZAMAX (n, x, incx)

DESCRIPTION
     ISAMAX/IDAMAX searches a real vector for the first occurrence of the
     maximum absolute value.

     ICAMAX/IZAMAX searches a complex vector for the first occurrence of
     the maximum absolute value.

     ISAMAX returns the first index i such that

          |xi| = MAX |xj| : j = 1, ..., n


     where xj is an element of a real vector.


     ICAMAX determines the first index i such that

          ||Real(xi)|+ |Imag(xi) | =


          MAX(|Real(xj)| + | Imag(xj)|): j = 1, ..., n

     where xj is an element of a complex vector.


     These functions have the following arguments:

     index Integer.  (output)
           First index of maximum absolute value.

     n     Integer.  (input)
           Number of elements to process in the vector to be searched.  If
           n <= 0, these routines return 0.

     x     Array of dimension (n-1) * |incx|+1.  (input)
           ISAMAX: Real array.
           IDAMAX: Double precision array.
           ICAMAX: Complex array.
           IZAMAX: Double complex array.

           Array x contains the vector to be searched.

     incx  Integer.  (input)
           Increment between elements of x.

NOTES
     When scanning backward (incx < 0), each routine starts at the end of
     the vector and moves backward, as follows:

          x(1-incx * (n-1)), x(1-incx * (n-2)), ..., x(1)

     The largest absolute value is:

          ABS (x(1+(index-1) * incx)) when incx > 0

          ABS (x(1+(n-index) * |incx|)) when incx < 0

     These routines are Level 1 Basic Linear Algebra Subprograms (Level 1
     BLAS).