LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
izmax1.f File Reference

Go to the source code of this file.

Functions/Subroutines

integer function izmax1 (N, CX, INCX)
 IZMAX1 finds the index of the vector element whose real part has maximum absolute value. More...
 

Function/Subroutine Documentation

integer function izmax1 ( integer  N,
complex*16, dimension( * )  CX,
integer  INCX 
)

IZMAX1 finds the index of the vector element whose real part has maximum absolute value.

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

Purpose:
 IZMAX1 finds the index of the element whose real part has 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 CX.
[in]CX
          CX is COMPLEX*16 array, dimension (N)
          The vector whose elements will be summed.
[in]INCX
          INCX is INTEGER
          The spacing between successive values of CX.  INCX >= 1.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012
Contributors:
Nick Higham for use with ZLACON.

Definition at line 83 of file izmax1.f.

83 *
84 * -- LAPACK auxiliary routine (version 3.4.2) --
85 * -- LAPACK is a software package provided by Univ. of Tennessee, --
86 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
87 * September 2012
88 *
89 * .. Scalar Arguments ..
90  INTEGER incx, n
91 * ..
92 * .. Array Arguments ..
93  COMPLEX*16 cx( * )
94 * ..
95 *
96 * =====================================================================
97 *
98 * .. Local Scalars ..
99  INTEGER i, ix
100  DOUBLE PRECISION smax
101  COMPLEX*16 zdum
102 * ..
103 * .. Intrinsic Functions ..
104  INTRINSIC abs
105 * ..
106 * .. Statement Functions ..
107  DOUBLE PRECISION cabs1
108 * ..
109 * .. Statement Function definitions ..
110 *
111 * NEXT LINE IS THE ONLY MODIFICATION.
112  cabs1( zdum ) = abs( zdum )
113 * ..
114 * .. Executable Statements ..
115 *
116  izmax1 = 0
117  IF( n.LT.1 )
118  $ RETURN
119  izmax1 = 1
120  IF( n.EQ.1 )
121  $ RETURN
122  IF( incx.EQ.1 )
123  $ GO TO 30
124 *
125 * CODE FOR INCREMENT NOT EQUAL TO 1
126 *
127  ix = 1
128  smax = cabs1( cx( 1 ) )
129  ix = ix + incx
130  DO 20 i = 2, n
131  IF( cabs1( cx( ix ) ).LE.smax )
132  $ GO TO 10
133  izmax1 = i
134  smax = cabs1( cx( ix ) )
135  10 CONTINUE
136  ix = ix + incx
137  20 CONTINUE
138  RETURN
139 *
140 * CODE FOR INCREMENT EQUAL TO 1
141 *
142  30 CONTINUE
143  smax = cabs1( cx( 1 ) )
144  DO 40 i = 2, n
145  IF( cabs1( cx( i ) ).LE.smax )
146  $ GO TO 40
147  izmax1 = i
148  smax = cabs1( cx( i ) )
149  40 CONTINUE
150  RETURN
151 *
152 * End of IZMAX1
153 *
integer function izmax1(N, CX, INCX)
IZMAX1 finds the index of the vector element whose real part has maximum absolute value...
Definition: izmax1.f:83