116 DOUBLE PRECISION FUNCTION zlansp( NORM, UPLO, N, AP, WORK )
128 DOUBLE PRECISION WORK( * )
135 DOUBLE PRECISION ONE, ZERO
136 parameter ( one = 1.0d+0, zero = 0.0d+0 )
140 DOUBLE PRECISION ABSA, SCALE, SUM, VALUE
143 LOGICAL LSAME, DISNAN
144 EXTERNAL lsame, disnan
150 INTRINSIC abs, dble, dimag, 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. disnan( sum ) )
VALUE = sum
173 DO 30 i = k, k + n - j
175 IF(
VALUE .LT. sum .OR. disnan( 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. disnan( 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. disnan( sum ) )
VALUE = sum
219 ELSE IF( ( lsame( norm,
'F' ) ) .OR. ( lsame( norm,
'E' ) ) )
THEN
226 IF( lsame( uplo,
'U' ) )
THEN
228 CALL zlassq( j-1, ap( k ), 1, scale, sum )
233 CALL zlassq( n-j, ap( k ), 1, scale, sum )
240 IF( dble( ap( k ) ).NE.zero )
THEN
241 absa = abs( dble( ap( k ) ) )
242 IF( scale.LT.absa )
THEN
243 sum = one + sum*( scale / absa )**2
246 sum = sum + ( absa / scale )**2
249 IF( dimag( ap( k ) ).NE.zero )
THEN
250 absa = abs( dimag( 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 )
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
double precision function zlansp(NORM, UPLO, N, AP, WORK)
ZLANSP 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.