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
icamin.f
Go to the documentation of this file.
1 c BLAS routine missing in ACML and some other implementations
2 
3  integer function icamin(n,cx,incx)
4 c
5 c finds the index of element having min. absolute value.
6 c
7  complex cx(*)
8  real smin
9  integer i,incx,ix,n
10  real cabs
11 c
12  icamin = 0
13  if( n.lt.1 .or. incx.le.0 ) return
14  icamin = 1
15  if(n.eq.1)return
16  if(incx.eq.1)go to 20
17 c
18 c code for increment not equal to 1
19 c
20  ix = 1
21  smin = cabs(cx(1))
22  ix = ix + incx
23  do 10 i = 2,n
24  if(cabs(cx(ix)).ge.smin) go to 5
25  icamin = i
26  smin = cabs(cx(ix))
27  5 ix = ix + incx
28  10 continue
29  return
30 c
31 c code for increment equal to 1
32 c
33  20 smin = cabs(cx(1))
34  do 30 i = 2,n
35  if(cabs(cx(i)).ge.smin) go to 30
36  icamin = i
37  smin = cabs(cx(i))
38  30 continue
39  return
40  end