LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ izmax1()

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.
Contributors:
Nick Higham for use with ZLACON.

Definition at line 78 of file izmax1.f.

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