142 DOUBLE PRECISION FUNCTION zlantr( NORM, UPLO, DIAG, M, N, A, LDA,
151 CHARACTER DIAG, NORM, UPLO
155 DOUBLE PRECISION WORK( * )
156 COMPLEX*16 A( lda, * )
162 DOUBLE PRECISION ONE, ZERO
163 parameter ( one = 1.0d+0, zero = 0.0d+0 )
168 DOUBLE PRECISION SCALE, SUM, VALUE
171 LOGICAL LSAME, DISNAN
172 EXTERNAL lsame, disnan
178 INTRINSIC abs, min, sqrt
182 IF( min( m, n ).EQ.0 )
THEN
184 ELSE IF( lsame( norm,
'M' ) )
THEN
188 IF( lsame( diag,
'U' ) )
THEN
190 IF( lsame( uplo,
'U' ) )
THEN
192 DO 10 i = 1, min( m, j-1 )
193 sum = abs( a( i, j ) )
194 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
200 sum = abs( a( i, j ) )
201 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
207 IF( lsame( uplo,
'U' ) )
THEN
209 DO 50 i = 1, min( m, j )
210 sum = abs( a( i, j ) )
211 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
217 sum = abs( a( i, j ) )
218 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
223 ELSE IF( ( lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
228 udiag = lsame( diag,
'U' )
229 IF( lsame( uplo,
'U' ) )
THEN
231 IF( ( udiag ) .AND. ( j.LE.m ) )
THEN
234 sum = sum + abs( a( i, j ) )
238 DO 100 i = 1, min( m, j )
239 sum = sum + abs( a( i, j ) )
242 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
249 sum = sum + abs( a( i, j ) )
254 sum = sum + abs( a( i, j ) )
257 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
260 ELSE IF( lsame( norm,
'I' ) )
THEN
264 IF( lsame( uplo,
'U' ) )
THEN
265 IF( lsame( diag,
'U' ) )
THEN
270 DO 160 i = 1, min( m, j-1 )
271 work( i ) = work( i ) + abs( a( i, j ) )
279 DO 190 i = 1, min( m, j )
280 work( i ) = work( i ) + abs( a( i, j ) )
285 IF( lsame( diag,
'U' ) )
THEN
294 work( i ) = work( i ) + abs( a( i, j ) )
303 work( i ) = work( i ) + abs( a( 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
322 CALL zlassq( min( m, j-1 ), a( 1, j ), 1, scale, sum )
328 CALL zlassq( min( m, j ), a( 1, j ), 1, scale, sum )
332 IF( lsame( diag,
'U' ) )
THEN
336 CALL zlassq( m-j, a( min( m, j+1 ), j ), 1, scale,
343 CALL zlassq( m-j+1, a( j, j ), 1, scale, sum )
347 VALUE = scale*sqrt( sum )
double precision function zlantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
ZLANTR 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 zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.