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