132 REAL FUNCTION clanhb( NORM, UPLO, N, K, AB, LDAB,
146 COMPLEX AB( ldab, * )
153 parameter ( one = 1.0e+0, zero = 0.0e+0 )
157 REAL ABSA, SCALE, SUM, VALUE
160 LOGICAL LSAME, SISNAN
161 EXTERNAL lsame, sisnan
167 INTRINSIC abs, max, min,
REAL, 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. sisnan( sum ) )
VALUE = sum
184 sum = abs(
REAL( AB( K+1, J ) ) )
185 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
189 sum = abs(
REAL( AB( 1, J ) ) )
190 IF(
VALUE .LT. sum .OR. sisnan( 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. sisnan( 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(
REAL( AB( K+1, J ) ) )
216 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
223 sum = work( j ) + abs(
REAL( 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. sisnan( sum ) )
VALUE = sum
233 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
240 IF( lsame( uplo,
'U' ) )
THEN
242 CALL classq( min( j-1, k ), ab( max( k+2-j, 1 ), j ),
248 CALL classq( min( n-j, k ), ab( 2, j ), 1, scale,
258 IF(
REAL( AB( L, J ) ).NE.zero ) then
259 absa = abs(
REAL( 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 classq(N, X, INCX, SCALE, SUMSQ)
CLASSQ updates a sum of squares represented in scaled form.
real function clanhb(NORM, UPLO, N, K, AB, LDAB, WORK)
CLANHB 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.