125 DOUBLE PRECISION FUNCTION zlanhe( NORM, UPLO, N, A, LDA, WORK )
137 DOUBLE PRECISION WORK( * )
138 COMPLEX*16 A( lda, * )
144 DOUBLE PRECISION ONE, ZERO
145 parameter ( one = 1.0d+0, zero = 0.0d+0 )
149 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
152 LOGICAL LSAME, DISNAN
153 EXTERNAL lsame, disnan
159 INTRINSIC abs, dble, sqrt
165 ELSE IF( lsame( norm,
'M' ) )
THEN
170 IF( lsame( uplo,
'U' ) )
THEN
173 sum = abs( a( i, j ) )
174 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
176 sum = abs( dble( a( j, j ) ) )
177 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
181 sum = abs( dble( a( j, j ) ) )
182 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
184 sum = abs( a( i, j ) )
185 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
189 ELSE IF( ( lsame( norm,
'I' ) ) .OR. ( lsame( norm,
'O' ) ) .OR.
190 $ ( norm.EQ.
'1' ) )
THEN
195 IF( lsame( uplo,
'U' ) )
THEN
199 absa = abs( a( i, j ) )
201 work( i ) = work( i ) + absa
203 work( j ) = sum + abs( dble( a( j, j ) ) )
207 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
214 sum = work( j ) + abs( dble( a( j, j ) ) )
216 absa = abs( a( i, j ) )
218 work( i ) = work( i ) + absa
220 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
223 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
229 IF( lsame( uplo,
'U' ) )
THEN
231 CALL zlassq( j-1, a( 1, j ), 1, scale, sum )
235 CALL zlassq( n-j, a( j+1, j ), 1, scale, sum )
240 IF( dble( a( i, i ) ).NE.zero )
THEN
241 absa = abs( dble( a( i, i ) ) )
242 IF( scale.LT.absa )
THEN
243 sum = one + sum*( scale / absa )**2
246 sum = sum + ( absa / scale )**2
250 VALUE = scale*sqrt( sum )
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, or the element of largest absolute value of a complex Hermitian matrix.
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.