131 SUBROUTINE zstt21( N, KBAND, AD, AE, SD, SE, U, LDU, WORK, RWORK,
139 INTEGER KBAND, LDU, N
142 DOUBLE PRECISION AD( * ), AE( * ), RESULT( 2 ), RWORK( * ),
144 COMPLEX*16 U( LDU, * ), WORK( * )
150 DOUBLE PRECISION ZERO, ONE
151 parameter( zero = 0.0d+0, one = 1.0d+0 )
152 COMPLEX*16 CZERO, CONE
153 parameter( czero = ( 0.0d+0, 0.0d+0 ),
154 $ cone = ( 1.0d+0, 0.0d+0 ) )
158 DOUBLE PRECISION ANORM, TEMP1, TEMP2, ULP, UNFL, WNORM
161 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANHE
162 EXTERNAL dlamch, zlange, zlanhe
168 INTRINSIC abs, dble, dcmplx, max, min
179 unfl = dlamch(
'Safe minimum' )
180 ulp = dlamch(
'Precision' )
186 CALL zlaset(
'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 zher(
'L', n, -sd( j ), u( 1, j ), 1, work, n )
208 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
210 CALL zher2(
'L', n, -dcmplx( se( j ) ), u( 1, j ), 1,
211 $ u( 1, j+1 ), 1, work, n )
215 wnorm = zlanhe(
'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, dble( n ) ) / ( n*ulp )
231 CALL zgemm(
'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( dble( n ), zlange(
'1', n, n, work, n,
239 $ rwork ) ) / ( n*ulp )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zher2(uplo, n, alpha, x, incx, y, incy, a, lda)
ZHER2
subroutine zher(uplo, n, alpha, x, incx, a, lda)
ZHER
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zstt21(n, kband, ad, ae, sd, se, u, ldu, work, rwork, result)
ZSTT21