137 DOUBLE PRECISION FUNCTION zlantb( NORM, UPLO, DIAG, N, K, AB,
145 CHARACTER diag, norm, uplo
149 DOUBLE PRECISION work( * )
150 COMPLEX*16 ab( ldab, * )
156 DOUBLE PRECISION one, zero
157 parameter( one = 1.0d+0, zero = 0.0d+0 )
162 DOUBLE PRECISION scale, sum, value
172 INTRINSIC abs, max, min, sqrt
178 ELSE IF(
lsame( norm,
'M' ) )
THEN
182 IF(
lsame( diag,
'U' ) )
THEN
184 IF(
lsame( uplo,
'U' ) )
THEN
186 DO 10 i = max( k+2-j, 1 ), k
187 sum = abs( ab( i, j ) )
188 IF(
VALUE .LT. sum .OR.
189 $
disnan( sum ) )
VALUE = sum
194 DO 30 i = 2, min( n+1-j, k+1 )
195 sum = abs( ab( i, j ) )
196 IF(
VALUE .LT. sum .OR.
197 $
disnan( sum ) )
VALUE = sum
203 IF(
lsame( uplo,
'U' ) )
THEN
205 DO 50 i = max( k+2-j, 1 ), k + 1
206 sum = abs( ab( i, j ) )
207 IF(
VALUE .LT. sum .OR.
208 $
disnan( sum ) )
VALUE = sum
213 DO 70 i = 1, min( n+1-j, k+1 )
214 sum = abs( ab( i, j ) )
215 IF(
VALUE .LT. sum .OR.
216 $
disnan( sum ) )
VALUE = sum
221 ELSE IF( (
lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
226 udiag =
lsame( diag,
'U' )
227 IF(
lsame( uplo,
'U' ) )
THEN
231 DO 90 i = max( k+2-j, 1 ), k
232 sum = sum + abs( ab( i, j ) )
236 DO 100 i = max( k+2-j, 1 ), k + 1
237 sum = sum + abs( ab( i, j ) )
240 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
246 DO 120 i = 2, min( n+1-j, k+1 )
247 sum = sum + abs( ab( i, j ) )
251 DO 130 i = 1, min( n+1-j, k+1 )
252 sum = sum + abs( ab( i, j ) )
255 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
258 ELSE IF(
lsame( norm,
'I' ) )
THEN
263 IF(
lsame( uplo,
'U' ) )
THEN
264 IF(
lsame( diag,
'U' ) )
THEN
270 DO 160 i = max( 1, j-k ), j - 1
271 work( i ) = work( i ) + abs( ab( l+i, j ) )
280 DO 190 i = max( 1, j-k ), j
281 work( i ) = work( i ) + abs( ab( l+i, j ) )
286 IF(
lsame( diag,
'U' ) )
THEN
292 DO 220 i = j + 1, min( n, j+k )
293 work( i ) = work( i ) + abs( ab( l+i, j ) )
302 DO 250 i = j, min( n, j+k )
303 work( i ) = work( i ) + abs( ab( l+i, j ) )
310 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
312 ELSE IF( (
lsame( norm,
'F' ) ) .OR.
313 $ (
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 ),
338 IF(
lsame( diag,
'U' ) )
THEN
343 CALL zlassq( min( n-j, k ), ab( 2, j ), 1,
352 CALL zlassq( min( n-j+1, k+1 ), ab( 1, j ), 1,
358 VALUE = scale*sqrt( sum )
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,...
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.