254 SUBROUTINE ztgsy2( TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC,
256 $ LDD, E, LDE, F, LDF, SCALE, RDSUM, RDSCAL,
265 INTEGER IJOB, INFO, LDA, LDB, LDC, LDD, LDE, LDF, M, N
266 DOUBLE PRECISION RDSCAL, RDSUM, SCALE
269 COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * ),
270 $ D( LDD, * ), E( LDE, * ), F( LDF, * )
276 DOUBLE PRECISION ZERO, ONE
278 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, ldz = 2 )
282 INTEGER I, IERR, J, K
283 DOUBLE PRECISION SCALOC
287 INTEGER IPIV( LDZ ), JPIV( LDZ )
288 COMPLEX*16 RHS( LDZ ), Z( LDZ, LDZ )
299 INTRINSIC dcmplx, dconjg, max
307 notran = lsame( trans,
'N' )
308 IF( .NOT.notran .AND. .NOT.lsame( trans,
'C' ) )
THEN
310 ELSE IF( notran )
THEN
311 IF( ( ijob.LT.0 ) .OR. ( ijob.GT.2 ) )
THEN
318 ELSE IF( n.LE.0 )
THEN
320 ELSE IF( lda.LT.max( 1, m ) )
THEN
322 ELSE IF( ldb.LT.max( 1, n ) )
THEN
324 ELSE IF( ldc.LT.max( 1, m ) )
THEN
326 ELSE IF( ldd.LT.max( 1, m ) )
THEN
328 ELSE IF( lde.LT.max( 1, n ) )
THEN
330 ELSE IF( ldf.LT.max( 1, m ) )
THEN
335 CALL xerbla(
'ZTGSY2', -info )
353 z( 1, 1 ) = a( i, i )
354 z( 2, 1 ) = d( i, i )
355 z( 1, 2 ) = -b( j, j )
356 z( 2, 2 ) = -e( j, j )
365 CALL zgetc2( ldz, z, ldz, ipiv, jpiv, ierr )
369 CALL zgesc2( ldz, z, ldz, rhs, ipiv, jpiv, scaloc )
370 IF( scaloc.NE.one )
THEN
372 CALL zscal( m, dcmplx( scaloc, zero ),
374 CALL zscal( m, dcmplx( scaloc, zero ),
380 CALL zlatdf( ijob, ldz, z, ldz, rhs, rdsum, rdscal,
393 CALL zaxpy( i-1, alpha, a( 1, i ), 1, c( 1, j ),
395 CALL zaxpy( i-1, alpha, d( 1, i ), 1, f( 1, j ),
399 CALL zaxpy( n-j, rhs( 2 ), b( j, j+1 ), ldb,
401 CALL zaxpy( n-j, rhs( 2 ), e( j, j+1 ), lde,
421 z( 1, 1 ) = dconjg( a( i, i ) )
422 z( 2, 1 ) = -dconjg( b( j, j ) )
423 z( 1, 2 ) = dconjg( d( i, i ) )
424 z( 2, 2 ) = -dconjg( e( j, j ) )
434 CALL zgetc2( ldz, z, ldz, ipiv, jpiv, ierr )
437 CALL zgesc2( ldz, z, ldz, rhs, ipiv, jpiv, scaloc )
438 IF( scaloc.NE.one )
THEN
440 CALL zscal( m, dcmplx( scaloc, zero ), c( 1,
443 CALL zscal( m, dcmplx( scaloc, zero ), f( 1,
458 f( i, k ) = f( i, k ) + rhs( 1 )*dconjg( b( k, j ) ) +
459 $ rhs( 2 )*dconjg( e( k, j ) )
462 c( k, j ) = c( k, j ) - dconjg( a( i, k ) )*rhs( 1 ) -
463 $ dconjg( d( i, k ) )*rhs( 2 )
subroutine ztgsy2(trans, ijob, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, rdsum, rdscal, info)
ZTGSY2 solves the generalized Sylvester equation (unblocked algorithm).