123 DOUBLE PRECISION FUNCTION dlansy( NORM, UPLO, N, A, LDA, WORK )
135 DOUBLE PRECISION A( lda, * ), WORK( * )
141 DOUBLE PRECISION ONE, ZERO
142 parameter ( one = 1.0d+0, zero = 0.0d+0 )
146 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
152 LOGICAL LSAME, DISNAN
153 EXTERNAL lsame, disnan
162 ELSE IF( lsame( norm,
'M' ) )
THEN
167 IF( lsame( uplo,
'U' ) )
THEN
170 sum = abs( a( i, j ) )
171 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
177 sum = abs( a( i, j ) )
178 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
182 ELSE IF( ( lsame( norm,
'I' ) ) .OR. ( lsame( norm,
'O' ) ) .OR.
183 $ ( norm.EQ.
'1' ) )
THEN
188 IF( lsame( uplo,
'U' ) )
THEN
192 absa = abs( a( i, j ) )
194 work( i ) = work( i ) + absa
196 work( j ) = sum + abs( a( j, j ) )
200 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
207 sum = work( j ) + abs( a( j, j ) )
209 absa = abs( a( i, j ) )
211 work( i ) = work( i ) + absa
213 IF(
VALUE .LT. sum .OR. disnan( sum ) )
VALUE = sum
216 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
222 IF( lsame( uplo,
'U' ) )
THEN
224 CALL dlassq( j-1, a( 1, j ), 1, scale, sum )
228 CALL dlassq( n-j, a( j+1, j ), 1, scale, sum )
232 CALL dlassq( n, a, lda+1, scale, sum )
233 VALUE = scale*sqrt( sum )
double precision function dlansy(NORM, UPLO, N, A, LDA, WORK)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix.
subroutine dlassq(N, X, INCX, SCALE, SUMSQ)
DLASSQ updates a sum of squares represented in scaled form.