139 DOUBLE PRECISION FUNCTION dlantr( NORM, UPLO, DIAG, M, N, A, LDA,
147 CHARACTER diag, norm, uplo
151 DOUBLE PRECISION a( lda, * ), work( * )
157 DOUBLE PRECISION one, zero
158 parameter( one = 1.0d+0, zero = 0.0d+0 )
163 DOUBLE PRECISION scale, sum, value
173 INTRINSIC abs, min, sqrt
177 IF( min( m, n ).EQ.0 )
THEN
179 ELSE IF(
lsame( norm,
'M' ) )
THEN
183 IF(
lsame( diag,
'U' ) )
THEN
185 IF(
lsame( uplo,
'U' ) )
THEN
187 DO 10 i = 1, min( m, j-1 )
188 sum = abs( a( i, j ) )
189 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
195 sum = abs( a( i, j ) )
196 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
202 IF(
lsame( uplo,
'U' ) )
THEN
204 DO 50 i = 1, min( m, j )
205 sum = abs( a( i, j ) )
206 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
212 sum = abs( a( i, j ) )
213 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
218 ELSE IF( (
lsame( norm,
'O' ) ) .OR. ( norm.EQ.
'1' ) )
THEN
223 udiag =
lsame( diag,
'U' )
224 IF(
lsame( uplo,
'U' ) )
THEN
226 IF( ( udiag ) .AND. ( j.LE.m ) )
THEN
229 sum = sum + abs( a( i, j ) )
233 DO 100 i = 1, min( m, j )
234 sum = sum + abs( a( i, j ) )
237 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
244 sum = sum + abs( a( i, j ) )
249 sum = sum + abs( a( i, j ) )
252 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
255 ELSE IF(
lsame( norm,
'I' ) )
THEN
259 IF(
lsame( uplo,
'U' ) )
THEN
260 IF(
lsame( diag,
'U' ) )
THEN
265 DO 160 i = 1, min( m, j-1 )
266 work( i ) = work( i ) + abs( a( i, j ) )
274 DO 190 i = 1, min( m, j )
275 work( i ) = work( i ) + abs( a( i, j ) )
280 IF(
lsame( diag,
'U' ) )
THEN
281 DO 210 i = 1, min( m, n )
289 work( i ) = work( i ) + abs( a( i, j ) )
298 work( i ) = work( i ) + abs( a( i, j ) )
306 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
308 ELSE IF( (
lsame( norm,
'F' ) ) .OR. (
lsame( norm,
'E' ) ) )
THEN
312 IF(
lsame( uplo,
'U' ) )
THEN
313 IF(
lsame( diag,
'U' ) )
THEN
317 CALL dlassq( min( m, j-1 ), a( 1, j ), 1, scale, sum )
323 CALL dlassq( min( m, j ), a( 1, j ), 1, scale, sum )
327 IF(
lsame( diag,
'U' ) )
THEN
331 CALL dlassq( m-j, a( min( m, j+1 ), j ), 1, scale,
338 CALL dlassq( m-j+1, a( j, j ), 1, scale, sum )
342 VALUE = scale*sqrt( sum )
logical function disnan(din)
DISNAN tests input for NaN.
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,...
subroutine dlassq(n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form.
logical function lsame(ca, cb)
LSAME