116 REAL FUNCTION clansp( NORM, UPLO, N, AP, WORK )
136 parameter ( one = 1.0e+0, zero = 0.0e+0 )
140 REAL ABSA, SCALE, SUM, VALUE
143 LOGICAL LSAME, SISNAN
144 EXTERNAL lsame, sisnan
150 INTRINSIC abs, aimag,
REAL, SQRT
156 ELSE IF( lsame( norm,
'M' ) )
THEN
161 IF( lsame( uplo,
'U' ) )
THEN
164 DO 10 i = k, k + j - 1
166 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
173 DO 30 i = k, k + n - j
175 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
180 ELSE IF( ( lsame( norm,
'I' ) ) .OR. ( lsame( norm,
'O' ) ) .OR.
181 $ ( norm.EQ.
'1' ) )
THEN
187 IF( lsame( uplo,
'U' ) )
THEN
191 absa = abs( ap( k ) )
193 work( i ) = work( i ) + absa
196 work( j ) = sum + abs( ap( k ) )
201 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
208 sum = work( j ) + abs( ap( k ) )
211 absa = abs( ap( k ) )
213 work( i ) = work( i ) + absa
216 IF(
VALUE .LT. sum .OR. sisnan( sum ) )
VALUE = sum
219 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
226 IF( lsame( uplo,
'U' ) )
THEN
228 CALL classq( j-1, ap( k ), 1, scale, sum )
233 CALL classq( n-j, ap( k ), 1, scale, sum )
240 IF(
REAL( AP( K ) ).NE.zero ) then
241 absa = abs(
REAL( AP( K ) ) )
242 IF( scale.LT.absa )
THEN
243 sum = one + sum*( scale / absa )**2
246 sum = sum + ( absa / scale )**2
249 IF( aimag( ap( k ) ).NE.zero )
THEN
250 absa = abs( aimag( ap( k ) ) )
251 IF( scale.LT.absa )
THEN
252 sum = one + sum*( scale / absa )**2
255 sum = sum + ( absa / scale )**2
258 IF( lsame( uplo,
'U' ) )
THEN
264 VALUE = scale*sqrt( sum )
real function clansp(NORM, UPLO, N, AP, WORK)
CLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
subroutine classq(N, X, INCX, SCALE, SUMSQ)
CLASSQ updates a sum of squares represented in scaled form.