112 REAL function
clansp( norm, uplo, n, ap, work )
131 parameter( one = 1.0e+0, zero = 0.0e+0 )
135 REAL absa, scale, sum, value
145 INTRINSIC abs, aimag, real, sqrt
151 ELSE IF(
lsame( norm,
'M' ) )
THEN
156 IF(
lsame( uplo,
'U' ) )
THEN
159 DO 10 i = k, k + j - 1
161 IF(
VALUE .LT. sum .OR.
sisnan( sum ) )
VALUE = sum
168 DO 30 i = k, k + n - j
170 IF(
VALUE .LT. sum .OR.
sisnan( sum ) )
VALUE = sum
175 ELSE IF( (
lsame( norm,
'I' ) ) .OR.
176 $ (
lsame( norm,
'O' ) ) .OR.
177 $ ( norm.EQ.
'1' ) )
THEN
183 IF(
lsame( uplo,
'U' ) )
THEN
187 absa = abs( ap( k ) )
189 work( i ) = work( i ) + absa
192 work( j ) = sum + abs( ap( k ) )
197 IF(
VALUE .LT. sum .OR.
sisnan( sum ) )
VALUE = sum
204 sum = work( j ) + abs( ap( k ) )
207 absa = abs( ap( k ) )
209 work( i ) = work( i ) + absa
212 IF(
VALUE .LT. sum .OR.
sisnan( sum ) )
VALUE = sum
215 ELSE IF( (
lsame( norm,
'F' ) ) .OR.
216 $ (
lsame( norm,
'E' ) ) )
THEN
223 IF(
lsame( uplo,
'U' ) )
THEN
225 CALL classq( j-1, ap( k ), 1, scale, sum )
230 CALL classq( n-j, ap( k ), 1, scale, sum )
237 IF( real( ap( k ) ).NE.zero )
THEN
238 absa = abs( real( ap( k ) ) )
239 IF( scale.LT.absa )
THEN
240 sum = one + sum*( scale / absa )**2
243 sum = sum + ( absa / scale )**2
246 IF( aimag( ap( k ) ).NE.zero )
THEN
247 absa = abs( aimag( 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 )
real function clansp(norm, uplo, n, ap, work)
CLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine classq(n, x, incx, scale, sumsq)
CLASSQ updates a sum of squares represented in scaled form.