153 SUBROUTINE zget51( ITYPE, N, A, LDA, B, LDB, U, LDU, V, LDV, WORK,
161 INTEGER ITYPE, LDA, LDB, LDU, LDV, N
162 DOUBLE PRECISION RESULT
165 DOUBLE PRECISION RWORK( * )
166 COMPLEX*16 A( LDA, * ), B( LDB, * ), U( LDU, * ),
167 $ v( ldv, * ), work( * )
173 DOUBLE PRECISION ZERO, ONE, TEN
174 parameter( zero = 0.0d+0, one = 1.0d+0, ten = 10.0d+0 )
175 COMPLEX*16 CZERO, CONE
176 parameter( czero = ( 0.0d+0, 0.0d+0 ),
177 $ cone = ( 1.0d+0, 0.0d+0 ) )
180 INTEGER JCOL, JDIAG, JROW
181 DOUBLE PRECISION ANORM, ULP, UNFL, WNORM
184 DOUBLE PRECISION DLAMCH, ZLANGE
185 EXTERNAL dlamch, zlange
191 INTRINSIC dble, max, min
201 unfl = dlamch(
'Safe minimum' )
202 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
206 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
211 IF( itype.LE.2 )
THEN
215 anorm = max( zlange(
'1', n, n, a, lda, rwork ), unfl )
217 IF( itype.EQ.1 )
THEN
221 CALL zlacpy(
' ', n, n, a, lda, work, n )
222 CALL zgemm(
'N',
'N', n, n, n, cone, u, ldu, b, ldb, czero,
223 $ work( n**2+1 ), n )
225 CALL zgemm(
'N',
'C', n, n, n, -cone, work( n**2+1 ), n, v,
226 $ ldv, cone, work, n )
232 CALL zlacpy(
' ', n, n, b, ldb, work, n )
236 work( jrow+n*( jcol-1 ) ) = work( jrow+n*( jcol-1 ) )
244 wnorm = zlange(
'1', n, n, work, n, rwork )
246 IF( anorm.GT.wnorm )
THEN
247 result = ( wnorm / anorm ) / ( n*ulp )
249 IF( anorm.LT.one )
THEN
250 result = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
252 result = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
262 CALL zgemm(
'N',
'C', n, n, n, cone, u, ldu, u, ldu, czero,
266 work( ( n+1 )*( jdiag-1 )+1 ) = work( ( n+1 )*( jdiag-1 )+
270 result = min( zlange(
'1', n, n, work, n, rwork ),
271 $ dble( n ) ) / ( n*ulp )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zget51(itype, n, a, lda, b, ldb, u, ldu, v, ldv, work, rwork, result)
ZGET51