HP MLIB User's Guide Vol. 1 7th Ed.

40 HP MLIB User’s Guide
ISAMAX/IDAMAX/IIAMAX/ICAMAX/IZAMAX Index of maximum of magnitudes
Legacy BLAS routines
Name ISAMAX/IDAMAX/IIAMAX/ICAMAX/IZAMAX
Index of maximum of magnitudes
Purpose Given a real or integer vector x of length n, ISAMAX, IDAMAX, or IIAMAX
determines the index of the element of the vector of maximum magnitude.
Specifically, the subprograms determine the smallest index i such that
Given a complex vector x of length n, ICAMAX or IZAMAX determines the
smallest index i:
where Re(x
i
) and Im(x
i
) are the real and imaginary parts of x
i
, respectively.
The usual definition of complex magnitude is
This definition is not used because of computational speed. If the index i is used
for pivot selection in matrix factorization, no significant difference in numerical
stability should result.
The vector can be stored in a one-dimensional array or in either a row or a
column of a two-dimensional array.
Usage VECLIB:
INTEGER*4 i, ISAMAX, n, incx
REAL*4 x(lenx)
i = ISAMAX(n, x, incx)
INTEGER*4 i, IDAMAX, n, incx
REAL*8 x(lenx)
i = IDAMAX(n, x, incx)
INTEGER*4 i, IIAMAX, n, incx, x(lenx)
i = IIAMAX(n, x, incx)
x
i
max
x
j
: j 12 n,, ,=


=
Re x
i
() Im x
i
()+ max Re x
j
() Im x
j
()+:j 12 n,, ,=()=
Re x
i
()
2
Im x
i
()
2
+



12