145 SUBROUTINE zbdt01( M, N, KD, A, LDA, Q, LDQ, D, E, PT, LDPT, WORK,
153 INTEGER KD, LDA, LDPT, LDQ, M, N
154 DOUBLE PRECISION RESID
157 DOUBLE PRECISION D( * ), E( * ), RWORK( * )
158 COMPLEX*16 A( LDA, * ), PT( LDPT, * ), Q( LDQ, * ),
165 DOUBLE PRECISION ZERO, ONE
166 parameter( zero = 0.0d+0, one = 1.0d+0 )
170 DOUBLE PRECISION ANORM, EPS
173 DOUBLE PRECISION DLAMCH, DZASUM, ZLANGE
174 EXTERNAL dlamch, dzasum, zlange
180 INTRINSIC dble, dcmplx, max, min
186 IF( m.LE.0 .OR. n.LE.0 )
THEN
198 IF( kd.NE.0 .AND. m.GE.n )
THEN
203 CALL zcopy( m, a( 1, j ), 1, work, 1 )
205 work( m+i ) = d( i )*pt( i, j ) + e( i )*pt( i+1, j )
207 work( m+n ) = d( n )*pt( n, j )
208 CALL zgemv(
'No transpose', m, n, -dcmplx( one ), q, ldq,
209 $ work( m+1 ), 1, dcmplx( one ), work, 1 )
210 resid = max( resid, dzasum( m, work, 1 ) )
212 ELSE IF( kd.LT.0 )
THEN
217 CALL zcopy( m, a( 1, j ), 1, work, 1 )
219 work( m+i ) = d( i )*pt( i, j ) + e( i )*pt( i+1, j )
221 work( m+m ) = d( m )*pt( m, j )
222 CALL zgemv(
'No transpose', m, m, -dcmplx( one ), q, ldq,
223 $ work( m+1 ), 1, dcmplx( one ), work, 1 )
224 resid = max( resid, dzasum( m, work, 1 ) )
231 CALL zcopy( m, a( 1, j ), 1, work, 1 )
232 work( m+1 ) = d( 1 )*pt( 1, j )
234 work( m+i ) = e( i-1 )*pt( i-1, j ) +
237 CALL zgemv(
'No transpose', m, m, -dcmplx( one ), q, ldq,
238 $ work( m+1 ), 1, dcmplx( one ), work, 1 )
239 resid = max( resid, dzasum( m, work, 1 ) )
248 CALL zcopy( m, a( 1, j ), 1, work, 1 )
250 work( m+i ) = d( i )*pt( i, j )
252 CALL zgemv(
'No transpose', m, n, -dcmplx( one ), q, ldq,
253 $ work( m+1 ), 1, dcmplx( one ), work, 1 )
254 resid = max( resid, dzasum( m, work, 1 ) )
258 CALL zcopy( m, a( 1, j ), 1, work, 1 )
260 work( m+i ) = d( i )*pt( i, j )
262 CALL zgemv(
'No transpose', m, m, -dcmplx( one ), q, ldq,
263 $ work( m+1 ), 1, dcmplx( one ), work, 1 )
264 resid = max( resid, dzasum( m, work, 1 ) )
271 anorm = zlange(
'1', m, n, a, lda, rwork )
272 eps = dlamch(
'Precision' )
274 IF( anorm.LE.zero )
THEN
278 IF( anorm.GE.resid )
THEN
279 resid = ( resid / anorm ) / ( dble( n )*eps )
281 IF( anorm.LT.one )
THEN
282 resid = ( min( resid, dble( n )*anorm ) / anorm ) /
285 resid = min( resid / anorm, dble( n ) ) /
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zbdt01(m, n, kd, a, lda, q, ldq, d, e, pt, ldpt, work, rwork, resid)
ZBDT01