140 DOUBLE PRECISION FUNCTION zlantr( NORM, UPLO, DIAG, M, N, A, LDA,
148 CHARACTER diag, norm, uplo
152 DOUBLE PRECISION work( * )
153 COMPLEX*16 a( lda, * )
159 DOUBLE PRECISION one, zero
160 parameter( one = 1.0d+0, zero = 0.0d+0 )
165 DOUBLE PRECISION scale, sum, value
175 INTRINSIC abs, min, sqrt
179 IF( min( m, n ).EQ.0 )
THEN
181 ELSE IF(
lsame( norm,
'M' ) )
THEN
185 IF(
lsame( diag,
'U' ) )
THEN
187 IF(
lsame( uplo,
'U' ) )
THEN
189 DO 10 i = 1, min( m, j-1 )
190 sum = abs( a( i, j ) )
191 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
197 sum = abs( a( i, j ) )
198 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
204 IF(
lsame( uplo,
'U' ) )
THEN
206 DO 50 i = 1, min( m, j )
207 sum = abs( a( i, j ) )
208 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
214 sum = abs( a( i, j ) )
215 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
220 ELSE IF( (
lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
225 udiag =
lsame( diag,
'U' )
226 IF(
lsame( uplo,
'U' ) )
THEN
228 IF( ( udiag ) .AND. ( j.LE.m ) )
THEN
231 sum = sum + abs( a( i, j ) )
235 DO 100 i = 1, min( m, j )
236 sum = sum + abs( a( i, j ) )
239 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
246 sum = sum + abs( a( i, j ) )
251 sum = sum + abs( a( i, j ) )
254 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
257 ELSE IF(
lsame( norm,
'I' ) )
THEN
261 IF(
lsame( uplo,
'U' ) )
THEN
262 IF(
lsame( diag,
'U' ) )
THEN
267 DO 160 i = 1, min( m, j-1 )
268 work( i ) = work( i ) + abs( a( i, j ) )
276 DO 190 i = 1, min( m, j )
277 work( i ) = work( i ) + abs( a( i, j ) )
282 IF(
lsame( diag,
'U' ) )
THEN
283 DO 210 i = 1, min( m, n )
291 work( i ) = work( i ) + abs( a( i, j ) )
300 work( i ) = work( i ) + abs( a( i, j ) )
308 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
310 ELSE IF( (
lsame( norm,
'F' ) ) .OR. (
lsame( norm,
'E' ) ) )
THEN
314 IF(
lsame( uplo,
'U' ) )
THEN
315 IF(
lsame( diag,
'U' ) )
THEN
319 CALL zlassq( min( m, j-1 ), a( 1, j ), 1, scale, sum )
325 CALL zlassq( min( m, j ), a( 1, j ), 1, scale, sum )
329 IF(
lsame( diag,
'U' ) )
THEN
333 CALL zlassq( m-j, a( min( m, j+1 ), j ), 1, scale,
340 CALL zlassq( m-j+1, a( j, j ), 1, scale, sum )
344 VALUE = scale*sqrt( sum )
logical function disnan(din)
DISNAN tests input for NaN.
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,...
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
logical function lsame(ca, cb)
LSAME