LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ icamax()

integer function icamax ( integer  N,
complex, dimension(*)  CX,
integer  INCX 
)

ICAMAX

Purpose:
    ICAMAX finds the index of the first element having maximum |Re(.)| + |Im(.)|
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]CX
          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of CX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 73 of file icamax.f.

73 *
74 * -- Reference BLAS level1 routine (version 3.8.0) --
75 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
76 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
77 * November 2017
78 *
79 * .. Scalar Arguments ..
80  INTEGER INCX,N
81 * ..
82 * .. Array Arguments ..
83  COMPLEX CX(*)
84 * ..
85 *
86 * =====================================================================
87 *
88 * .. Local Scalars ..
89  REAL SMAX
90  INTEGER I,IX
91 * ..
92 * .. External Functions ..
93  REAL SCABS1
94  EXTERNAL scabs1
95 * ..
96  icamax = 0
97  IF (n.LT.1 .OR. incx.LE.0) RETURN
98  icamax = 1
99  IF (n.EQ.1) RETURN
100  IF (incx.EQ.1) THEN
101 *
102 * code for increment equal to 1
103 *
104  smax = scabs1(cx(1))
105  DO i = 2,n
106  IF (scabs1(cx(i)).GT.smax) THEN
107  icamax = i
108  smax = scabs1(cx(i))
109  END IF
110  END DO
111  ELSE
112 *
113 * code for increment not equal to 1
114 *
115  ix = 1
116  smax = scabs1(cx(1))
117  ix = ix + incx
118  DO i = 2,n
119  IF (scabs1(cx(ix)).GT.smax) THEN
120  icamax = i
121  smax = scabs1(cx(ix))
122  END IF
123  ix = ix + incx
124  END DO
125  END IF
126  RETURN
Here is the call graph for this function:
Here is the caller graph for this function:
scabs1
real function scabs1(Z)
SCABS1
Definition: scabs1.f:48
icamax
integer function icamax(N, CX, INCX)
ICAMAX
Definition: icamax.f:73