138 DOUBLE PRECISION FUNCTION zlantr( NORM, UPLO, DIAG, M, N, A,
147 CHARACTER diag, norm, uplo
151 DOUBLE PRECISION work( * )
152 COMPLEX*16 a( lda, * )
158 DOUBLE PRECISION one, zero
159 PARAMETER ( one = 1.0d+0, zero = 0.0d+0 )
164 DOUBLE PRECISION scale, sum, value
174 INTRINSIC abs, min, sqrt
178 IF( min( m, n ).EQ.0 )
THEN
180 ELSE IF(
lsame( norm,
'M' ) )
THEN
184 IF(
lsame( diag,
'U' ) )
THEN
186 IF(
lsame( uplo,
'U' ) )
THEN
188 DO 10 i = 1, min( m, j-1 )
189 sum = abs( a( i, j ) )
190 IF(
VALUE .LT. sum .OR.
191 $
disnan( sum ) )
VALUE = sum
197 sum = abs( a( i, j ) )
198 IF(
VALUE .LT. sum .OR.
199 $
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.
210 $
disnan( sum ) )
VALUE = sum
216 sum = abs( a( i, j ) )
217 IF(
VALUE .LT. sum .OR.
218 $
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
286 DO 210 i = 1, min( m, n )
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.
314 $ (
lsame( norm,
'E' ) ) )
THEN
318 IF(
lsame( uplo,
'U' ) )
THEN
319 IF(
lsame( diag,
'U' ) )
THEN
323 CALL zlassq( min( m, j-1 ), a( 1, j ), 1, scale,
330 CALL zlassq( min( m, j ), a( 1, j ), 1, scale,
335 IF(
lsame( diag,
'U' ) )
THEN
339 CALL zlassq( m-j, a( min( m, j+1 ), j ), 1, scale,
346 CALL zlassq( m-j+1, a( j, j ), 1, scale, sum )
350 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,...
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.