155 SUBROUTINE ztrsyl( TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C,
163 CHARACTER TRANA, TRANB
164 INTEGER INFO, ISGN, LDA, LDB, LDC, M, N
165 DOUBLE PRECISION SCALE
168 COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * )
175 parameter( one = 1.0d+0 )
178 LOGICAL NOTRNA, NOTRNB
180 DOUBLE PRECISION BIGNUM, DA11, DB, EPS, SCALOC, SGN, SMIN,
182 COMPLEX*16 A11, SUML, SUMR, VEC, X11
185 DOUBLE PRECISION DUM( 1 )
189 DOUBLE PRECISION DLAMCH, ZLANGE
190 COMPLEX*16 ZDOTC, ZDOTU, ZLADIV
191 EXTERNAL lsame, dlamch, zlange, zdotc, zdotu, zladiv
197 INTRINSIC abs, dble, dcmplx, dconjg, dimag, max, min
203 notrna = lsame( trana,
'N' )
204 notrnb = lsame( tranb,
'N' )
207 IF( .NOT.notrna .AND. .NOT.lsame( trana,
'C' ) )
THEN
209 ELSE IF( .NOT.notrnb .AND. .NOT.lsame( tranb,
'C' ) )
THEN
211 ELSE IF( isgn.NE.1 .AND. isgn.NE.-1 )
THEN
213 ELSE IF( m.LT.0 )
THEN
215 ELSE IF( n.LT.0 )
THEN
217 ELSE IF( lda.LT.max( 1, m ) )
THEN
219 ELSE IF( ldb.LT.max( 1, n ) )
THEN
221 ELSE IF( ldc.LT.max( 1, m ) )
THEN
225 CALL xerbla(
'ZTRSYL', -info )
232 IF( m.EQ.0 .OR. n.EQ.0 )
238 smlnum = dlamch(
'S' )
239 bignum = one / smlnum
240 smlnum = smlnum*dble( m*n ) / eps
241 bignum = one / smlnum
242 smin = max( smlnum, eps*zlange(
'M', m, m, a, lda, dum ),
243 $ eps*zlange(
'M', n, n, b, ldb, dum ) )
246 IF( notrna .AND. notrnb )
THEN
263 suml = zdotu( m-k, a( k, min( k+1, m ) ), lda,
264 $ c( min( k+1, m ), l ), 1 )
265 sumr = zdotu( l-1, c( k, 1 ), ldc, b( 1, l ), 1 )
266 vec = c( k, l ) - ( suml+sgn*sumr )
269 a11 = a( k, k ) + sgn*b( l, l )
270 da11 = abs( dble( a11 ) ) + abs( dimag( a11 ) )
271 IF( da11.LE.smin )
THEN
276 db = abs( dble( vec ) ) + abs( dimag( vec ) )
277 IF( da11.LT.one .AND. db.GT.one )
THEN
278 IF( db.GT.bignum*da11 )
281 x11 = zladiv( vec*dcmplx( scaloc ), a11 )
283 IF( scaloc.NE.one )
THEN
285 CALL zdscal( m, scaloc, c( 1, j ), 1 )
294 ELSE IF( .NOT.notrna .AND. notrnb )
THEN
311 suml = zdotc( k-1, a( 1, k ), 1, c( 1, l ), 1 )
312 sumr = zdotu( l-1, c( k, 1 ), ldc, b( 1, l ), 1 )
313 vec = c( k, l ) - ( suml+sgn*sumr )
316 a11 = dconjg( a( k, k ) ) + sgn*b( l, l )
317 da11 = abs( dble( a11 ) ) + abs( dimag( a11 ) )
318 IF( da11.LE.smin )
THEN
323 db = abs( dble( vec ) ) + abs( dimag( vec ) )
324 IF( da11.LT.one .AND. db.GT.one )
THEN
325 IF( db.GT.bignum*da11 )
329 x11 = zladiv( vec*dcmplx( scaloc ), a11 )
331 IF( scaloc.NE.one )
THEN
333 CALL zdscal( m, scaloc, c( 1, j ), 1 )
342 ELSE IF( .NOT.notrna .AND. .NOT.notrnb )
THEN
362 suml = zdotc( k-1, a( 1, k ), 1, c( 1, l ), 1 )
363 sumr = zdotc( n-l, c( k, min( l+1, n ) ), ldc,
364 $ b( l, min( l+1, n ) ), ldb )
365 vec = c( k, l ) - ( suml+sgn*dconjg( sumr ) )
368 a11 = dconjg( a( k, k )+sgn*b( l, l ) )
369 da11 = abs( dble( a11 ) ) + abs( dimag( a11 ) )
370 IF( da11.LE.smin )
THEN
375 db = abs( dble( vec ) ) + abs( dimag( vec ) )
376 IF( da11.LT.one .AND. db.GT.one )
THEN
377 IF( db.GT.bignum*da11 )
381 x11 = zladiv( vec*dcmplx( scaloc ), a11 )
383 IF( scaloc.NE.one )
THEN
385 CALL zdscal( m, scaloc, c( 1, j ), 1 )
394 ELSE IF( notrna .AND. .NOT.notrnb )
THEN
411 suml = zdotu( m-k, a( k, min( k+1, m ) ), lda,
412 $ c( min( k+1, m ), l ), 1 )
413 sumr = zdotc( n-l, c( k, min( l+1, n ) ), ldc,
414 $ b( l, min( l+1, n ) ), ldb )
415 vec = c( k, l ) - ( suml+sgn*dconjg( sumr ) )
418 a11 = a( k, k ) + sgn*dconjg( b( l, l ) )
419 da11 = abs( dble( a11 ) ) + abs( dimag( a11 ) )
420 IF( da11.LE.smin )
THEN
425 db = abs( dble( vec ) ) + abs( dimag( vec ) )
426 IF( da11.LT.one .AND. db.GT.one )
THEN
427 IF( db.GT.bignum*da11 )
431 x11 = zladiv( vec*dcmplx( scaloc ), a11 )
433 IF( scaloc.NE.one )
THEN
435 CALL zdscal( m, scaloc, c( 1, j ), 1 )
subroutine xerbla(srname, info)
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine ztrsyl(trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale, info)
ZTRSYL