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
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 )