LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
integer function izmax1 ( integer  N,
complex*16, dimension(*)  ZX,
integer  INCX 
)

IZMAX1 finds the index of the first vector element of maximum absolute value.

Download IZMAX1 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 IZMAX1 finds the index of the first vector element of maximum absolute value.

 Based on IZAMAX from Level 1 BLAS.
 The change is to use the 'genuine' absolute value.
Parameters
[in]N
          N is INTEGER
          The number of elements in the vector ZX.
[in]ZX
          ZX is COMPLEX*16 array, dimension (N)
          The vector ZX. The IZMAX1 function returns the index of its first
          element of maximum absolute value.
[in]INCX
          INCX is INTEGER
          The spacing between successive values of ZX.  INCX >= 1.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
February 2014
Contributors:
Nick Higham for use with ZLACON.

Definition at line 83 of file izmax1.f.

83 *
84 * -- LAPACK auxiliary routine (version 3.6.0) --
85 * -- LAPACK is a software package provided by Univ. of Tennessee, --
86 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
87 * February 2014
88 *
89 * .. Scalar Arguments ..
90  INTEGER incx, n
91 * ..
92 * .. Array Arguments ..
93  COMPLEX*16 zx(*)
94 * ..
95 *
96 * =====================================================================
97 *
98 * .. Local Scalars ..
99  DOUBLE PRECISION dmax
100  INTEGER i, ix
101 * ..
102 * .. Intrinsic Functions ..
103  INTRINSIC abs
104 * ..
105 * .. Executable Statements ..
106 *
107  izmax1 = 0
108  IF (n.LT.1 .OR. incx.LE.0) RETURN
109  izmax1 = 1
110  IF (n.EQ.1) RETURN
111  IF (incx.EQ.1) THEN
112 *
113 * code for increment equal to 1
114 *
115  dmax = abs(zx(1))
116  DO i = 2,n
117  IF (abs(zx(i)).GT.dmax) THEN
118  izmax1 = i
119  dmax = abs(zx(i))
120  END IF
121  END DO
122  ELSE
123 *
124 * code for increment not equal to 1
125 *
126  ix = 1
127  dmax = abs(zx(1))
128  ix = ix + incx
129  DO i = 2,n
130  IF (abs(zx(ix)).GT.dmax) THEN
131  izmax1 = i
132  dmax = abs(zx(ix))
133  END IF
134  ix = ix + incx
135  END DO
136  END IF
137  RETURN
138 *
139 * End of IZMAX1
140 *
integer function izmax1(N, ZX, INCX)
IZMAX1 finds the index of the first vector element of maximum absolute value.
Definition: izmax1.f:83