132 DOUBLE PRECISION FUNCTION zlanhb( NORM, UPLO, N, K, AB, LDAB,
145 DOUBLE PRECISION WORK( * )
146 COMPLEX*16 AB( ldab, * )
152 DOUBLE PRECISION ONE, ZERO
153 parameter ( one = 1.0d+0, zero = 0.0d+0 )
157 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
160 LOGICAL LSAME, DISNAN
161 EXTERNAL lsame, disnan
167 INTRINSIC abs, dble, max, min, sqrt
173 ELSE IF( lsame( norm,
'M' ) )
THEN
178 IF( lsame( uplo,
'U' ) )
THEN
180 DO 10 i = max( k+2-j, 1 ), k
181 sum = abs( ab( i, j ) )
182 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
184 sum = abs( dble( ab( k+1, j ) ) )
185 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
189 sum = abs( dble( ab( 1, j ) ) )
190 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
191 DO 30 i = 2, min( n+1-j, k+1 )
192 sum = abs( ab( i, j ) )
193 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
197 ELSE IF( ( lsame( norm,
'I' ) ) .OR. ( lsame( norm,
'O' ) ) .OR.
198 $ ( norm.EQ.
'1' ) )
THEN
203 IF( lsame( uplo,
'U' ) )
THEN
207 DO 50 i = max( 1, j-k ), j - 1
208 absa = abs( ab( l+i, j ) )
210 work( i ) = work( i ) + absa
212 work( j ) = sum + abs( dble( ab( k+1, j ) ) )
216 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
223 sum = work( j ) + abs( dble( ab( 1, j ) ) )
225 DO 90 i = j + 1, min( n, j+k )
226 absa = abs( ab( l+i, j ) )
228 work( i ) = work( i ) + absa
230 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
233 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
240 IF( lsame( uplo,
'U' ) )
THEN
242 CALL zlassq( min( j-1, k ), ab( max( k+2-j, 1 ), j ),
248 CALL zlassq( min( n-j, k ), ab( 2, j ), 1, scale,
258 IF( dble( ab( l, j ) ).NE.zero )
THEN
259 absa = abs( dble( ab( l, j ) ) )
260 IF( scale.LT.absa )
THEN
261 sum = one + sum*( scale / absa )**2
264 sum = sum + ( absa / scale )**2
268 VALUE = scale*sqrt( sum )
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
double precision function zlanhb(NORM, UPLO, N, K, AB, LDAB, WORK)
ZLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix.