131 SUBROUTINE cstt21( N, KBAND, AD, AE, SD, SE, U, LDU, WORK, RWORK,
139 INTEGER KBAND, LDU, N
142 REAL AD( * ), AE( * ), RESULT( 2 ), RWORK( * ),
144 COMPLEX U( LDU, * ), WORK( * )
151 parameter( zero = 0.0e+0, one = 1.0e+0 )
153 parameter( czero = ( 0.0e+0, 0.0e+0 ),
154 $ cone = ( 1.0e+0, 0.0e+0 ) )
158 REAL ANORM, TEMP1, TEMP2, ULP, UNFL, WNORM
161 REAL CLANGE, CLANHE, SLAMCH
162 EXTERNAL clange, clanhe, slamch
168 INTRINSIC abs, cmplx, max, min, real
179 unfl = slamch(
'Safe minimum' )
180 ulp = slamch(
'Precision' )
186 CALL claset(
'Full', n, n, czero, czero, work, n )
192 work( ( n+1 )*( j-1 )+1 ) = ad( j )
193 work( ( n+1 )*( j-1 )+2 ) = ae( j )
194 temp2 = abs( ae( j ) )
195 anorm = max( anorm, abs( ad( j ) )+temp1+temp2 )
199 work( n**2 ) = ad( n )
200 anorm = max( anorm, abs( ad( n ) )+temp1, unfl )
205 CALL cher(
'L', n, -sd( j ), u( 1, j ), 1, work, n )
208 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
210 CALL cher2(
'L', n, -cmplx( se( j ) ), u( 1, j ), 1,
211 $ u( 1, j+1 ), 1, work, n )
215 wnorm = clanhe(
'1',
'L', n, work, n, rwork )
217 IF( anorm.GT.wnorm )
THEN
218 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
220 IF( anorm.LT.one )
THEN
221 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
223 result( 1 ) = min( wnorm / anorm, real( n ) ) / ( n*ulp )
231 CALL cgemm(
'N',
'C', n, n, n, cone, u, ldu, u, ldu, czero, work,
235 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - cone
238 result( 2 ) = min( real( n ), clange(
'1', n, n, work, n,
239 $ rwork ) ) / ( n*ulp )
subroutine cstt21(n, kband, ad, ae, sd, se, u, ldu, work, rwork, result)
CSTT21
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cher2(uplo, n, alpha, x, incx, y, incy, a, lda)
CHER2
subroutine cher(uplo, n, alpha, x, incx, a, lda)
CHER
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.