256 SUBROUTINE ctgsy2( TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC, D,
257 $ LDD, E, LDE, F, LDF, SCALE, RDSUM, RDSCAL,
266 INTEGER IJOB, INFO, LDA, LDB, LDC, LDD, LDE, LDF, M, N
267 REAL RDSCAL, RDSUM, SCALE
270 COMPLEX A( LDA, * ), B( LDB, * ), C( LDC, * ),
271 $ D( LDD, * ), E( LDE, * ), F( LDF, * )
279 parameter( zero = 0.0e+0, one = 1.0e+0, ldz = 2 )
283 INTEGER I, IERR, J, K
288 INTEGER IPIV( LDZ ), JPIV( LDZ )
289 COMPLEX RHS( LDZ ), Z( LDZ, LDZ )
299 INTRINSIC cmplx, conjg, 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(
'CTGSY2', -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 cgetc2( ldz, z, ldz, ipiv, jpiv, ierr )
369 CALL cgesc2( ldz, z, ldz, rhs, ipiv, jpiv, scaloc )
370 IF( scaloc.NE.one )
THEN
372 CALL cscal( m, cmplx( scaloc, zero ), c( 1, k ),
374 CALL cscal( m, cmplx( scaloc, zero ), f( 1, k ),
380 CALL clatdf( ijob, ldz, z, ldz, rhs, rdsum, rdscal,
393 CALL caxpy( i-1, alpha, a( 1, i ), 1, c( 1, j ), 1 )
394 CALL caxpy( i-1, alpha, d( 1, i ), 1, f( 1, j ), 1 )
397 CALL caxpy( n-j, rhs( 2 ), b( j, j+1 ), ldb,
399 CALL caxpy( n-j, rhs( 2 ), e( j, j+1 ), lde,
419 z( 1, 1 ) = conjg( a( i, i ) )
420 z( 2, 1 ) = -conjg( b( j, j ) )
421 z( 1, 2 ) = conjg( d( i, i ) )
422 z( 2, 2 ) = -conjg( e( j, j ) )
432 CALL cgetc2( ldz, z, ldz, ipiv, jpiv, ierr )
435 CALL cgesc2( ldz, z, ldz, rhs, ipiv, jpiv, scaloc )
436 IF( scaloc.NE.one )
THEN
438 CALL cscal( m, cmplx( scaloc, zero ), c( 1, k ),
440 CALL cscal( m, cmplx( scaloc, zero ), f( 1, k ),
454 f( i, k ) = f( i, k ) + rhs( 1 )*conjg( b( k, j ) ) +
455 $ rhs( 2 )*conjg( e( k, j ) )
458 c( k, j ) = c( k, j ) - conjg( a( i, k ) )*rhs( 1 ) -
459 $ conjg( d( i, k ) )*rhs( 2 )
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine cgesc2(n, a, lda, rhs, ipiv, jpiv, scale)
CGESC2 solves a system of linear equations using the LU factorization with complete pivoting computed...
subroutine cgetc2(n, a, lda, ipiv, jpiv, info)
CGETC2 computes the LU factorization with complete pivoting of the general n-by-n matrix.
subroutine clatdf(ijob, n, z, ldz, rhs, rdsum, rdscal, ipiv, jpiv)
CLATDF uses the LU factorization of the n-by-n matrix computed by sgetc2 and computes a contribution ...
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine ctgsy2(trans, ijob, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, rdsum, rdscal, info)
CTGSY2 solves the generalized Sylvester equation (unblocked algorithm).