LAPACK
3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
izmax1.f
Go to the documentation of this file.
1
*> \brief \b IZMAX1 finds the index of the first vector element of maximum absolute value.
2
*
3
* =========== DOCUMENTATION ===========
4
*
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
7
*
8
*> Download IZMAX1 + dependencies
9
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/izmax1.f">
10
*> [TGZ]</a>
11
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/izmax1.f">
12
*> [ZIP]</a>
13
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/izmax1.f">
14
*> [TXT]</a>
15
*
16
* Definition:
17
* ===========
18
*
19
* INTEGER FUNCTION IZMAX1( N, ZX, INCX )
20
*
21
* .. Scalar Arguments ..
22
* INTEGER INCX, N
23
* ..
24
* .. Array Arguments ..
25
* COMPLEX*16 ZX( * )
26
* ..
27
*
28
*
29
*> \par Purpose:
30
* =============
31
*>
32
*> \verbatim
33
*>
34
*> IZMAX1 finds the index of the first vector element of maximum absolute value.
35
*>
36
*> Based on IZAMAX from Level 1 BLAS.
37
*> The change is to use the 'genuine' absolute value.
38
*> \endverbatim
39
*
40
* Arguments:
41
* ==========
42
*
43
*> \param[in] N
44
*> \verbatim
45
*> N is INTEGER
46
*> The number of elements in the vector ZX.
47
*> \endverbatim
48
*>
49
*> \param[in] ZX
50
*> \verbatim
51
*> ZX is COMPLEX*16 array, dimension (N)
52
*> The vector ZX. The IZMAX1 function returns the index of its first
53
*> element of maximum absolute value.
54
*> \endverbatim
55
*>
56
*> \param[in] INCX
57
*> \verbatim
58
*> INCX is INTEGER
59
*> The spacing between successive values of ZX. INCX >= 1.
60
*> \endverbatim
61
*
62
* Authors:
63
* ========
64
*
65
*> \author Univ. of Tennessee
66
*> \author Univ. of California Berkeley
67
*> \author Univ. of Colorado Denver
68
*> \author NAG Ltd.
69
*
70
*> \ingroup imax1
71
*
72
*> \par Contributors:
73
* ==================
74
*>
75
*> Nick Higham for use with ZLACON.
76
*
77
* =====================================================================
78
INTEGER
FUNCTION
izmax1
( N, ZX, INCX )
79
*
80
* -- LAPACK auxiliary routine --
81
* -- LAPACK is a software package provided by Univ. of Tennessee, --
82
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
83
*
84
* .. Scalar Arguments ..
85
INTEGER
incx, n
86
* ..
87
* .. Array Arguments ..
88
COMPLEX*16
zx(*)
89
* ..
90
*
91
* =====================================================================
92
*
93
* .. Local Scalars ..
94
DOUBLE PRECISION
dmax
95
INTEGER
i, ix
96
* ..
97
* .. Intrinsic Functions ..
98
INTRINSIC
abs
99
* ..
100
* .. Executable Statements ..
101
*
102
izmax1
= 0
103
IF
(n.LT.1 .OR. incx.LE.0)
RETURN
104
izmax1
= 1
105
IF
(n.EQ.1)
RETURN
106
IF
(incx.EQ.1)
THEN
107
*
108
* code for increment equal to 1
109
*
110
dmax = abs(zx(1))
111
DO
i = 2,n
112
IF
(abs(zx(i)).GT.dmax)
THEN
113
izmax1
= i
114
dmax = abs(zx(i))
115
END IF
116
END DO
117
ELSE
118
*
119
* code for increment not equal to 1
120
*
121
ix = 1
122
dmax = abs(zx(1))
123
ix = ix + incx
124
DO
i = 2,n
125
IF
(abs(zx(ix)).GT.dmax)
THEN
126
izmax1
= i
127
dmax = abs(zx(ix))
128
END IF
129
ix = ix + incx
130
END DO
131
END IF
132
RETURN
133
*
134
* End of IZMAX1
135
*
136
END
izmax1
integer function izmax1(n, zx, incx)
IZMAX1 finds the index of the first vector element of maximum absolute value.
Definition
izmax1.f:79
SRC
izmax1.f
Generated on Mon Jan 20 2025 17:18:11 for LAPACK by
1.11.0