150 SUBROUTINE chbt21( UPLO, N, KA, KS, A, LDA, D, E, U, LDU, WORK,
159 INTEGER KA, KS, LDA, LDU, N
162 REAL D( * ), E( * ), RESULT( 2 ), RWORK( * )
163 COMPLEX A( LDA, * ), U( LDU, * ), WORK( * )
170 parameter( czero = ( 0.0e+0, 0.0e+0 ),
171 $ cone = ( 1.0e+0, 0.0e+0 ) )
173 parameter( zero = 0.0e+0, one = 1.0e+0 )
178 INTEGER IKA, J, JC, JR
179 REAL ANORM, ULP, UNFL, WNORM
183 REAL CLANGE, CLANHB, CLANHP, SLAMCH
184 EXTERNAL lsame, clange, clanhb, clanhp, slamch
190 INTRINSIC cmplx, max, min, real
201 ika = max( 0, min( n-1, ka ) )
203 IF( lsame( uplo,
'U' ) )
THEN
211 unfl = slamch(
'Safe minimum' )
212 ulp = slamch(
'Epsilon' )*slamch(
'Base' )
220 anorm = max( clanhb(
'1', cuplo, n, ika, a, lda, rwork ), unfl )
229 DO 10 jr = 1, min( ika+1, n+1-jc )
231 work( j ) = a( jr, jc )
233 DO 20 jr = ika + 2, n + 1 - jc
238 DO 30 jr = ika + 2, jc
242 DO 40 jr = min( ika, jc-1 ), 0, -1
244 work( j ) = a( ika+1-jr, jc )
250 CALL chpr( cuplo, n, -d( j ), u( 1, j ), 1, work )
253 IF( n.GT.1 .AND. ks.EQ.1 )
THEN
255 CALL chpr2( cuplo, n, -cmplx( e( j ) ), u( 1, j ), 1,
256 $ u( 1, j+1 ), 1, work )
259 wnorm = clanhp(
'1', cuplo, n, work, rwork )
261 IF( anorm.GT.wnorm )
THEN
262 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
264 IF( anorm.LT.one )
THEN
265 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
267 result( 1 ) = min( wnorm / anorm, real( n ) ) / ( n*ulp )
275 CALL cgemm(
'N',
'C', n, n, n, cone, u, ldu, u, ldu, czero, work,
279 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - cone
282 result( 2 ) = min( clange(
'1', n, n, work, n, rwork ),
283 $ real( n ) ) / ( n*ulp )
subroutine chbt21(uplo, n, ka, ks, a, lda, d, e, u, ldu, work, rwork, result)
CHBT21
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine chpr2(uplo, n, alpha, x, incx, y, incy, ap)
CHPR2
subroutine chpr(uplo, n, alpha, x, incx, ap)
CHPR