140 REAL function
clantr( norm, uplo, diag, m, n, a, lda,
148 CHARACTER diag, norm, uplo
160 parameter( one = 1.0e+0, zero = 0.0e+0 )
165 REAL 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.
sisnan( sum ) )
VALUE = sum
197 sum = abs( a( i, j ) )
198 IF(
VALUE .LT. sum .OR.
sisnan( 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.
sisnan( sum ) )
VALUE = sum
214 sum = abs( a( i, j ) )
215 IF(
VALUE .LT. sum .OR.
sisnan( 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.
sisnan( sum ) )
VALUE = sum
246 sum = sum + abs( a( i, j ) )
251 sum = sum + abs( a( i, j ) )
254 IF(
VALUE .LT. sum .OR.
sisnan( 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.
sisnan( 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 classq( min( m, j-1 ), a( 1, j ), 1, scale, sum )
325 CALL classq( min( m, j ), a( 1, j ), 1, scale, sum )
329 IF(
lsame( diag,
'U' ) )
THEN
333 CALL classq( m-j, a( min( m, j+1 ), j ), 1, scale,
340 CALL classq( m-j+1, a( j, j ), 1, scale, sum )
344 VALUE = scale*sqrt( sum )
logical function sisnan(sin)
SISNAN tests input for NaN.
real function clantr(norm, uplo, diag, m, n, a, lda, work)
CLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine classq(n, x, incx, scale, sumsq)
CLASSQ updates a sum of squares represented in scaled form.
logical function lsame(ca, cb)
LSAME