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