141 DOUBLE PRECISION FUNCTION dlantr( NORM, UPLO, DIAG, M, N, A, LDA,
150 CHARACTER DIAG, NORM, UPLO
154 DOUBLE PRECISION A( lda, * ), WORK( * )
160 DOUBLE PRECISION ONE, ZERO
161 parameter ( one = 1.0d+0, zero = 0.0d+0 )
166 DOUBLE PRECISION SCALE, SUM, VALUE
172 LOGICAL LSAME, DISNAN
173 EXTERNAL lsame, disnan
176 INTRINSIC abs, min, sqrt
180 IF( min( m, n ).EQ.0 )
THEN
182 ELSE IF( lsame( norm,
'M' ) )
THEN
186 IF( lsame( diag,
'U' ) )
THEN
188 IF( lsame( uplo,
'U' ) )
THEN
190 DO 10 i = 1, min( m, j-1 )
191 sum = abs( a( i, j ) )
192 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
198 sum = abs( a( i, j ) )
199 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
205 IF( lsame( uplo,
'U' ) )
THEN
207 DO 50 i = 1, min( m, j )
208 sum = abs( a( i, j ) )
209 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
215 sum = abs( a( i, j ) )
216 IF(
VALUE .LT. sum .OR. 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
229 IF( ( udiag ) .AND. ( j.LE.m ) )
THEN
232 sum = sum + abs( a( i, j ) )
236 DO 100 i = 1, min( m, j )
237 sum = sum + abs( a( i, j ) )
240 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
247 sum = sum + abs( a( i, j ) )
252 sum = sum + abs( a( i, j ) )
255 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
258 ELSE IF( lsame( norm,
'I' ) )
THEN
262 IF( lsame( uplo,
'U' ) )
THEN
263 IF( lsame( diag,
'U' ) )
THEN
268 DO 160 i = 1, min( m, j-1 )
269 work( i ) = work( i ) + abs( a( i, j ) )
277 DO 190 i = 1, min( m, j )
278 work( i ) = work( i ) + abs( a( i, j ) )
283 IF( lsame( diag,
'U' ) )
THEN
292 work( i ) = work( i ) + abs( a( i, j ) )
301 work( i ) = work( i ) + abs( a( i, j ) )
309 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
311 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
315 IF( lsame( uplo,
'U' ) )
THEN
316 IF( lsame( diag,
'U' ) )
THEN
320 CALL dlassq( min( m, j-1 ), a( 1, j ), 1, scale, sum )
326 CALL dlassq( min( m, j ), a( 1, j ), 1, scale, sum )
330 IF( lsame( diag,
'U' ) )
THEN
334 CALL dlassq( m-j, a( min( m, j+1 ), j ), 1, scale,
341 CALL dlassq( m-j+1, a( j, j ), 1, scale, sum )
345 VALUE = scale*sqrt( sum )
double precision function dlantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
DLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.
subroutine dlassq(N, X, INCX, SCALE, SUMSQ)
DLASSQ updates a sum of squares represented in scaled form.