CVM Class Library  8.1
This C++ class library encapsulates concepts of vector and different matrices including square, band, symmetric and hermitian ones in Euclidean space of real and complex numbers.
 All Classes Files Functions Variables Typedefs Friends Macros Pages
izamax.f
Go to the documentation of this file.
1 c BLAS routine missing in ACML and some other implementations
2 
3  integer function izamax(n,zx,incx)
4 c
5 c finds the index of element having max. absolute value.
6 c jack dongarra, 1/15/85.
7 c modified 3/93 to return if incx .le. 0.
8 c modified 12/3/93, array(1) declarations changed to array(*)
9 c
10  double complex zx(*)
11  double precision smax
12  integer i,incx,ix,n
13  double precision cdabs
14 c
15  izamax = 0
16  if( n.lt.1 .or. incx.le.0 )return
17  izamax = 1
18  if(n.eq.1)return
19  if(incx.eq.1)go to 20
20 c
21 c code for increment not equal to 1
22 c
23  ix = 1
24  smax = cdabs(zx(1))
25  ix = ix + incx
26  do 10 i = 2,n
27  if(cdabs(zx(ix)).le.smax) go to 5
28  izamax = i
29  smax = cdabs(zx(ix))
30  5 ix = ix + incx
31  10 continue
32  return
33 c
34 c code for increment equal to 1
35 c
36  20 smax = cdabs(zx(1))
37  do 30 i = 2,n
38  if(cdabs(zx(i)).le.smax) go to 30
39  izamax = i
40  smax = cdabs(zx(i))
41  30 continue
42  return
43  end