 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ zlanhe()

 double precision function zlanhe ( character NORM, character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) WORK )

ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.

Purpose:
``` ZLANHE  returns the value of the one norm,  or the Frobenius norm, or
the  infinity norm,  or the  element of  largest absolute value  of a
complex hermitian matrix A.```
Returns
ZLANHE
```    ZLANHE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A),         NORM = '1', 'O' or 'o'
(
( normI(A),         NORM = 'I' or 'i'
(
( normF(A),         NORM = 'F', 'f', 'E' or 'e'

where  norm1  denotes the  one norm of a matrix (maximum column sum),
normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
normF  denotes the  Frobenius norm of a matrix (square root of sum of
squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.```
Parameters
 [in] NORM ``` NORM is CHARACTER*1 Specifies the value to be returned in ZLANHE as described above.``` [in] UPLO ``` UPLO is CHARACTER*1 Specifies whether the upper or lower triangular part of the hermitian matrix A is to be referenced. = 'U': Upper triangular part of A is referenced = 'L': Lower triangular part of A is referenced``` [in] N ``` N is INTEGER The order of the matrix A. N >= 0. When N = 0, ZLANHE is set to zero.``` [in] A ``` A is COMPLEX*16 array, dimension (LDA,N) The hermitian matrix A. If UPLO = 'U', the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. Note that the imaginary parts of the diagonal elements need not be set and are assumed to be zero.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(N,1).``` [out] WORK ``` WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)), where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise, WORK is not referenced.```

Definition at line 123 of file zlanhe.f.

124 *
125 * -- LAPACK auxiliary routine --
126 * -- LAPACK is a software package provided by Univ. of Tennessee, --
127 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128 *
129 * .. Scalar Arguments ..
130  CHARACTER NORM, UPLO
131  INTEGER LDA, N
132 * ..
133 * .. Array Arguments ..
134  DOUBLE PRECISION WORK( * )
135  COMPLEX*16 A( LDA, * )
136 * ..
137 *
138 * =====================================================================
139 *
140 * .. Parameters ..
141  DOUBLE PRECISION ONE, ZERO
142  parameter( one = 1.0d+0, zero = 0.0d+0 )
143 * ..
144 * .. Local Scalars ..
145  INTEGER I, J
146  DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
147 * ..
148 * .. External Functions ..
149  LOGICAL LSAME, DISNAN
150  EXTERNAL lsame, disnan
151 * ..
152 * .. External Subroutines ..
153  EXTERNAL zlassq
154 * ..
155 * .. Intrinsic Functions ..
156  INTRINSIC abs, dble, sqrt
157 * ..
158 * .. Executable Statements ..
159 *
160  IF( n.EQ.0 ) THEN
161  VALUE = zero
162  ELSE IF( lsame( norm, 'M' ) ) THEN
163 *
164 * Find max(abs(A(i,j))).
165 *
166  VALUE = zero
167  IF( lsame( uplo, 'U' ) ) THEN
168  DO 20 j = 1, n
169  DO 10 i = 1, j - 1
170  sum = abs( a( i, j ) )
171  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
172  10 CONTINUE
173  sum = abs( dble( a( j, j ) ) )
174  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
175  20 CONTINUE
176  ELSE
177  DO 40 j = 1, n
178  sum = abs( dble( a( j, j ) ) )
179  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
180  DO 30 i = j + 1, n
181  sum = abs( a( i, j ) )
182  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
183  30 CONTINUE
184  40 CONTINUE
185  END IF
186  ELSE IF( ( lsame( norm, 'I' ) ) .OR. ( lsame( norm, 'O' ) ) .OR.
187  \$ ( norm.EQ.'1' ) ) THEN
188 *
189 * Find normI(A) ( = norm1(A), since A is hermitian).
190 *
191  VALUE = zero
192  IF( lsame( uplo, 'U' ) ) THEN
193  DO 60 j = 1, n
194  sum = zero
195  DO 50 i = 1, j - 1
196  absa = abs( a( i, j ) )
197  sum = sum + absa
198  work( i ) = work( i ) + absa
199  50 CONTINUE
200  work( j ) = sum + abs( dble( a( j, j ) ) )
201  60 CONTINUE
202  DO 70 i = 1, n
203  sum = work( i )
204  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
205  70 CONTINUE
206  ELSE
207  DO 80 i = 1, n
208  work( i ) = zero
209  80 CONTINUE
210  DO 100 j = 1, n
211  sum = work( j ) + abs( dble( a( j, j ) ) )
212  DO 90 i = j + 1, n
213  absa = abs( a( i, j ) )
214  sum = sum + absa
215  work( i ) = work( i ) + absa
216  90 CONTINUE
217  IF( VALUE .LT. sum .OR. disnan( sum ) ) VALUE = sum
218  100 CONTINUE
219  END IF
220  ELSE IF( ( lsame( norm, 'F' ) ) .OR. ( lsame( norm, 'E' ) ) ) THEN
221 *
222 * Find normF(A).
223 *
224  scale = zero
225  sum = one
226  IF( lsame( uplo, 'U' ) ) THEN
227  DO 110 j = 2, n
228  CALL zlassq( j-1, a( 1, j ), 1, scale, sum )
229  110 CONTINUE
230  ELSE
231  DO 120 j = 1, n - 1
232  CALL zlassq( n-j, a( j+1, j ), 1, scale, sum )
233  120 CONTINUE
234  END IF
235  sum = 2*sum
236  DO 130 i = 1, n
237  IF( dble( a( i, i ) ).NE.zero ) THEN
238  absa = abs( dble( a( i, i ) ) )
239  IF( scale.LT.absa ) THEN
240  sum = one + sum*( scale / absa )**2
241  scale = absa
242  ELSE
243  sum = sum + ( absa / scale )**2
244  END IF
245  END IF
246  130 CONTINUE
247  VALUE = scale*sqrt( sum )
248  END IF
249 *
250  zlanhe = VALUE
251  RETURN
252 *
253 * End of ZLANHE
254 *
logical function disnan(DIN)
DISNAN tests input for NaN.
Definition: disnan.f:59
subroutine zlassq(n, x, incx, scl, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f90:137
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition: zlanhe.f:124
Here is the call graph for this function:
Here is the caller graph for this function: