114 DOUBLE PRECISION FUNCTION zlansp( NORM, UPLO, N, AP, WORK )
125 DOUBLE PRECISION work( * )
132 DOUBLE PRECISION one, zero
133 parameter( one = 1.0d+0, zero = 0.0d+0 )
137 DOUBLE PRECISION absa, scale, sum, value
147 INTRINSIC abs, dble, dimag, sqrt
153 ELSE IF(
lsame( norm,
'M' ) )
THEN
158 IF(
lsame( uplo,
'U' ) )
THEN
161 DO 10 i = k, k + j - 1
163 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
170 DO 30 i = k, k + n - j
172 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
177 ELSE IF( (
lsame( norm,
'I' ) ) .OR. (
lsame( norm,
'O' ) ) .OR.
178 $ ( norm.EQ.
'1' ) )
THEN
184 IF(
lsame( uplo,
'U' ) )
THEN
188 absa = abs( ap( k ) )
190 work( i ) = work( i ) + absa
193 work( j ) = sum + abs( ap( k ) )
198 IF(
VALUE .LT. sum .OR.
disnan( sum ) )
VALUE = sum
205 sum = work( j ) + abs( ap( k ) )
208 absa = abs( ap( k ) )
210 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
223 IF(
lsame( uplo,
'U' ) )
THEN
225 CALL zlassq( j-1, ap( k ), 1, scale, sum )
230 CALL zlassq( n-j, ap( k ), 1, scale, sum )
237 IF( dble( ap( k ) ).NE.zero )
THEN
238 absa = abs( dble( ap( k ) ) )
239 IF( scale.LT.absa )
THEN
240 sum = one + sum*( scale / absa )**2
243 sum = sum + ( absa / scale )**2
246 IF( dimag( ap( k ) ).NE.zero )
THEN
247 absa = abs( dimag( ap( k ) ) )
248 IF( scale.LT.absa )
THEN
249 sum = one + sum*( scale / absa )**2
252 sum = sum + ( absa / scale )**2
255 IF(
lsame( uplo,
'U' ) )
THEN
261 VALUE = scale*sqrt( sum )
logical function disnan(din)
DISNAN tests input for NaN.
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,...
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
logical function lsame(ca, cb)
LSAME