fix build error
[platform/upstream/openblas.git] / reference / ixamaxf.f
1       integer function ixamaxf(n,zx,incx)
2 c
3 c     finds the index of element having max. absolute value.
4 c     jack dongarra, 1/15/85.
5 c     modified 3/93 to return if incx .le. 0.
6 c     modified 12/3/93, array(1) declarations changed to array(*)
7 c
8       complex*20 zx(*)
9       real*10 smax
10       integer i,incx,ix,n
11       real*10 qcabs1
12 c
13       ixamaxf = 0
14       if( n.lt.1 .or. incx.le.0 )return
15       ixamaxf = 1
16       if(n.eq.1)return
17       if(incx.eq.1)go to 20
18 c
19 c        code for increment not equal to 1
20 c
21       ix = 1
22       smax = qcabs1(zx(1))
23       ix = ix + incx
24       do 10 i = 2,n
25          if(qcabs1(zx(ix)).le.smax) go to 5
26          ixamaxf = i
27          smax = qcabs1(zx(ix))
28     5    ix = ix + incx
29    10 continue
30       return
31 c
32 c        code for increment equal to 1
33 c
34    20 smax = qcabs1(zx(1))
35       do 30 i = 2,n
36          if(qcabs1(zx(i)).le.smax) go to 30
37          ixamaxf = i
38          smax = qcabs1(zx(i))
39    30 continue
40       return
41       end