KTH framework for Nek5000 toolboxes; testing version  0.0.1
izmax1.f
Go to the documentation of this file.
1  INTEGER FUNCTION izmax1( N, CX, INCX )
2 *
3 * -- LAPACK auxiliary routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * September 30, 1994
7 *
8 * .. Scalar Arguments ..
9  INTEGER incx, n
10 * ..
11 * .. Array Arguments ..
12  COMPLEX*16 cx( * )
13 * ..
14 *
15 * Purpose
16 * =======
17 *
18 * IZMAX1 finds the index of the element whose real part has maximum
19 * absolute value.
20 *
21 * Based on IZAMAX from Level 1 BLAS.
22 * The change is to use the 'genuine' absolute value.
23 *
24 * Contributed by Nick Higham for use with ZLACON.
25 *
26 * Arguments
27 * =========
28 *
29 * N (input) INTEGER
30 * The number of elements in the vector CX.
31 *
32 * CX (input) COMPLEX*16 array, dimension (N)
33 * The vector whose elements will be summed.
34 *
35 * INCX (input) INTEGER
36 * The spacing between successive values of CX. INCX >= 1.
37 *
38 * =====================================================================
39 *
40 * .. Local Scalars ..
41  INTEGER i, ix
42  DOUBLE PRECISION smax
43  COMPLEX*16 zdum
44 * ..
45 * .. Intrinsic Functions ..
46  INTRINSIC abs, dble
47 * ..
48 * .. Statement Functions ..
49  DOUBLE PRECISION cabs1
50 * ..
51 * .. Statement Function definitions ..
52 *
53 * NEXT LINE IS THE ONLY MODIFICATION.
54  cabs1( zdum ) = abs( dble( zdum ) )
55 * ..
56 * .. Executable Statements ..
57 *
58  izmax1 = 0
59  IF( n.LT.1 )
60  $ RETURN
61  izmax1 = 1
62  IF( n.EQ.1 )
63  $ RETURN
64  IF( incx.EQ.1 )
65  $ GO TO 30
66 *
67 * CODE FOR INCREMENT NOT EQUAL TO 1
68 *
69  ix = 1
70  smax = cabs1( cx( 1 ) )
71  ix = ix + incx
72  DO 20 i = 2, n
73  IF( cabs1( cx( ix ) ).LE.smax )
74  $ GO TO 10
75  izmax1 = i
76  smax = cabs1( cx( ix ) )
77  10 CONTINUE
78  ix = ix + incx
79  20 CONTINUE
80  RETURN
81 *
82 * CODE FOR INCREMENT EQUAL TO 1
83 *
84  30 CONTINUE
85  smax = cabs1( cx( 1 ) )
86  DO 40 i = 2, n
87  IF( cabs1( cx( i ) ).LE.smax )
88  $ GO TO 40
89  izmax1 = i
90  smax = cabs1( cx( i ) )
91  40 CONTINUE
92  RETURN
93 *
94 * End of IZMAX1
95 *
96  END
integer function izmax1(N, CX, INCX)
Definition: izmax1.f:2