141 DOUBLE PRECISION FUNCTION zlantb( NORM, UPLO, DIAG, N, K, AB,
150 CHARACTER DIAG, NORM, UPLO
154 DOUBLE PRECISION WORK( * )
155 COMPLEX*16 AB( ldab, * )
161 DOUBLE PRECISION ONE, ZERO
162 parameter ( one = 1.0d+0, zero = 0.0d+0 )
167 DOUBLE PRECISION SCALE, SUM, VALUE
170 LOGICAL LSAME, DISNAN
171 EXTERNAL lsame, disnan
177 INTRINSIC abs, max, min, sqrt
183 ELSE IF( lsame( norm,
'M' ) )
THEN
187 IF( lsame( diag,
'U' ) )
THEN
189 IF( lsame( uplo,
'U' ) )
THEN
191 DO 10 i = max( k+2-j, 1 ), k
192 sum = abs( ab( i, j ) )
193 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
198 DO 30 i = 2, min( n+1-j, k+1 )
199 sum = abs( ab( i, j ) )
200 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
206 IF( lsame( uplo,
'U' ) )
THEN
208 DO 50 i = max( k+2-j, 1 ), k + 1
209 sum = abs( ab( i, j ) )
210 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
215 DO 70 i = 1, min( n+1-j, k+1 )
216 sum = abs( ab( i, j ) )
217 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
222 ELSE IF( ( lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
227 udiag = lsame( diag,
'U' )
228 IF( lsame( uplo,
'U' ) )
THEN
232 DO 90 i = max( k+2-j, 1 ), k
233 sum = sum + abs( ab( i, j ) )
237 DO 100 i = max( k+2-j, 1 ), k + 1
238 sum = sum + abs( ab( i, j ) )
241 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
247 DO 120 i = 2, min( n+1-j, k+1 )
248 sum = sum + abs( ab( i, j ) )
252 DO 130 i = 1, min( n+1-j, k+1 )
253 sum = sum + abs( ab( i, j ) )
256 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
259 ELSE IF( lsame( norm,
'I' ) )
THEN
264 IF( lsame( uplo,
'U' ) )
THEN
265 IF( lsame( diag,
'U' ) )
THEN
271 DO 160 i = max( 1, j-k ), j - 1
272 work( i ) = work( i ) + abs( ab( l+i, j ) )
281 DO 190 i = max( 1, j-k ), j
282 work( i ) = work( i ) + abs( ab( l+i, j ) )
287 IF( lsame( diag,
'U' ) )
THEN
293 DO 220 i = j + 1, min( n, j+k )
294 work( i ) = work( i ) + abs( ab( l+i, j ) )
303 DO 250 i = j, min( n, j+k )
304 work( i ) = work( i ) + abs( ab( l+i, j ) )
311 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
313 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
317 IF( lsame( uplo,
'U' ) )
THEN
318 IF( lsame( diag,
'U' ) )
THEN
323 CALL zlassq( min( j-1, k ),
324 $ ab( max( k+2-j, 1 ), j ), 1, scale,
332 CALL zlassq( min( j, k+1 ), ab( max( k+2-j, 1 ), j ),
337 IF( lsame( diag,
'U' ) )
THEN
342 CALL zlassq( min( n-j, k ), ab( 2, j ), 1, scale,
350 CALL zlassq( min( n-j+1, k+1 ), ab( 1, j ), 1, scale,
355 VALUE = scale*sqrt( sum )
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
double precision function zlantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
ZLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix.