Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/reference/ixaminf.f
|
kusano |
2b45e8 |
integer function ixaminf(n,zx,incx)
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c finds the index of element having min. absolute value.
|
|
kusano |
2b45e8 |
c jack dongarra, 1/15/85.
|
|
kusano |
2b45e8 |
c modified 3/93 to return if incx .le. 0.
|
|
kusano |
2b45e8 |
c modified 12/3/93, array(1) declarations changed to array(*)
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
complex*20 zx(*)
|
|
kusano |
2b45e8 |
real*10 smin
|
|
kusano |
2b45e8 |
integer i,incx,ix,n
|
|
kusano |
2b45e8 |
real*10 qcabs1
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
ixaminf = 0
|
|
kusano |
2b45e8 |
if( n.lt.1 .or. incx.le.0 )return
|
|
kusano |
2b45e8 |
ixaminf = 1
|
|
kusano |
2b45e8 |
if(n.eq.1)return
|
|
kusano |
2b45e8 |
if(incx.eq.1)go to 20
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c code for increment not equal to 1
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
ix = 1
|
|
kusano |
2b45e8 |
smin = qcabs1(zx(1))
|
|
kusano |
2b45e8 |
ix = ix + incx
|
|
kusano |
2b45e8 |
do 10 i = 2,n
|
|
kusano |
2b45e8 |
if(qcabs1(zx(ix)).ge.smin) go to 5
|
|
kusano |
2b45e8 |
ixaminf = i
|
|
kusano |
2b45e8 |
smin = qcabs1(zx(ix))
|
|
kusano |
2b45e8 |
5 ix = ix + incx
|
|
kusano |
2b45e8 |
10 continue
|
|
kusano |
2b45e8 |
return
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
c code for increment equal to 1
|
|
kusano |
2b45e8 |
c
|
|
kusano |
2b45e8 |
20 smin = qcabs1(zx(1))
|
|
kusano |
2b45e8 |
do 30 i = 2,n
|
|
kusano |
2b45e8 |
if(qcabs1(zx(i)).ge.smin) go to 30
|
|
kusano |
2b45e8 |
ixaminf = i
|
|
kusano |
2b45e8 |
smin = qcabs1(zx(i))
|
|
kusano |
2b45e8 |
30 continue
|
|
kusano |
2b45e8 |
return
|
|
kusano |
2b45e8 |
end
|