125 REAL FUNCTION clanhe( NORM, UPLO, N, A, LDA, WORK )
145 parameter( one = 1.0e+0, zero = 0.0e+0 )
149 REAL absa, scale, sum, value
159 INTRINSIC abs,
REAL, sqrt
165 ELSE IF(
lsame( norm,
'M' ) )
THEN
170 IF(
lsame( uplo,
'U' ) )
THEN
173 sum = abs( a( i, j ) )
174 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
176 sum = abs(
REAL( A( J, J ) ) )
177 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
181 sum = abs(
REAL( A( J, J ) ) )
182 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
184 sum = abs( a( i, j ) )
185 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
189 ELSE IF( (
lsame( norm,
'I' ) ) .OR. (
lsame( norm,
'O' ) ) .OR.
190 $ ( norm.EQ.
'1' ) )
THEN
195 IF(
lsame( uplo,
'U' ) )
THEN
199 absa = abs( a( i, j ) )
201 work( i ) = work( i ) + absa
203 work( j ) = sum + abs(
REAL( A( J, J ) ) )
207 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
214 sum = work( j ) + abs(
REAL( A( J, J ) ) )
216 absa = abs( a( i, j ) )
218 work( i ) = work( i ) + absa
220 IF( value .LT. sum .OR.
sisnan( sum ) ) value = sum
223 ELSE IF( (
lsame( norm,
'F' ) ) .OR. (
lsame( norm,
'E' ) ) )
THEN
229 IF(
lsame( uplo,
'U' ) )
THEN
231 CALL
classq( j-1, a( 1, j ), 1, scale, sum )
235 CALL
classq( n-j, a( j+1, j ), 1, scale, sum )
240 IF(
REAL( A( I, I ) ).NE.zero ) then
241 absa = abs(
REAL( A( I, I ) ) )
242 IF( scale.LT.absa )
THEN
243 sum = one + sum*( scale / absa )**2
246 sum = sum + ( absa / scale )**2
250 value = scale*sqrt( sum )