136 DOUBLE PRECISION FUNCTION dlantb( NORM, UPLO, DIAG, N, K, AB,
144 CHARACTER diag, norm, uplo
148 DOUBLE PRECISION ab( ldab, * ), work( * )
154 DOUBLE PRECISION one, zero
155 parameter( one = 1.0d+0, zero = 0.0d+0 )
160 DOUBLE PRECISION scale, sum, value
170 INTRINSIC abs, max, min, sqrt
176 ELSE IF(
lsame( norm,
'M' ) )
THEN
180 IF(
lsame( diag,
'U' ) )
THEN
182 IF(
lsame( uplo,
'U' ) )
THEN
184 DO 10 i = max( k+2-j, 1 ), k
185 sum = abs( ab( i, j ) )
186 IF(
VALUE .LT. sum .OR.
187 $
disnan( sum ) )
VALUE = sum
192 DO 30 i = 2, min( n+1-j, k+1 )
193 sum = abs( ab( i, j ) )
194 IF(
VALUE .LT. sum .OR.
195 $
disnan( sum ) )
VALUE = sum
201 IF(
lsame( uplo,
'U' ) )
THEN
203 DO 50 i = max( k+2-j, 1 ), k + 1
204 sum = abs( ab( i, j ) )
205 IF(
VALUE .LT. sum .OR.
206 $
disnan( sum ) )
VALUE = sum
211 DO 70 i = 1, min( n+1-j, k+1 )
212 sum = abs( ab( i, j ) )
213 IF(
VALUE .LT. sum .OR.
214 $
disnan( sum ) )
VALUE = sum
219 ELSE IF( (
lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
224 udiag =
lsame( diag,
'U' )
225 IF(
lsame( uplo,
'U' ) )
THEN
229 DO 90 i = max( k+2-j, 1 ), k
230 sum = sum + abs( ab( i, j ) )
234 DO 100 i = max( k+2-j, 1 ), k + 1
235 sum = sum + abs( ab( i, j ) )
238 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
244 DO 120 i = 2, min( n+1-j, k+1 )
245 sum = sum + abs( ab( i, j ) )
249 DO 130 i = 1, min( n+1-j, k+1 )
250 sum = sum + abs( ab( i, j ) )
253 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
256 ELSE IF(
lsame( norm,
'I' ) )
THEN
261 IF(
lsame( uplo,
'U' ) )
THEN
262 IF(
lsame( diag,
'U' ) )
THEN
268 DO 160 i = max( 1, j-k ), j - 1
269 work( i ) = work( i ) + abs( ab( l+i, j ) )
278 DO 190 i = max( 1, j-k ), j
279 work( i ) = work( i ) + abs( ab( l+i, j ) )
284 IF(
lsame( diag,
'U' ) )
THEN
290 DO 220 i = j + 1, min( n, j+k )
291 work( i ) = work( i ) + abs( ab( l+i, j ) )
300 DO 250 i = j, min( n, j+k )
301 work( i ) = work( i ) + abs( ab( l+i, j ) )
308 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
310 ELSE IF( (
lsame( norm,
'F' ) ) .OR.
311 $ (
lsame( norm,
'E' ) ) )
THEN
315 IF(
lsame( uplo,
'U' ) )
THEN
316 IF(
lsame( diag,
'U' ) )
THEN
321 CALL dlassq( min( j-1, k ),
322 $ ab( max( k+2-j, 1 ), j ), 1, scale,
330 CALL dlassq( min( j, k+1 ), ab( max( k+2-j, 1 ),
336 IF(
lsame( diag,
'U' ) )
THEN
341 CALL dlassq( min( n-j, k ), ab( 2, j ), 1,
350 CALL dlassq( min( n-j+1, k+1 ), ab( 1, j ), 1,
356 VALUE = scale*sqrt( sum )
double precision function dlantb(norm, uplo, diag, n, k, ab, ldab, work)
DLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine dlassq(n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form.