200 SUBROUTINE cgghrd( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB,
202 $ LDQ, Z, LDZ, INFO )
209 CHARACTER COMPQ, COMPZ
210 INTEGER IHI, ILO, INFO, LDA, LDB, LDQ, LDZ, N
213 COMPLEX A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
221 PARAMETER ( CONE = ( 1.0e+0, 0.0e+0 ),
222 $ czero = ( 0.0e+0, 0.0e+0 ) )
226 INTEGER ICOMPQ, ICOMPZ, JCOL, JROW
244 IF( lsame( compq,
'N' ) )
THEN
247 ELSE IF( lsame( compq,
'V' ) )
THEN
250 ELSE IF( lsame( compq,
'I' ) )
THEN
259 IF( lsame( compz,
'N' ) )
THEN
262 ELSE IF( lsame( compz,
'V' ) )
THEN
265 ELSE IF( lsame( compz,
'I' ) )
THEN
275 IF( icompq.LE.0 )
THEN
277 ELSE IF( icompz.LE.0 )
THEN
279 ELSE IF( n.LT.0 )
THEN
281 ELSE IF( ilo.LT.1 )
THEN
283 ELSE IF( ihi.GT.n .OR. ihi.LT.ilo-1 )
THEN
285 ELSE IF( lda.LT.max( 1, n ) )
THEN
287 ELSE IF( ldb.LT.max( 1, n ) )
THEN
289 ELSE IF( ( ilq .AND. ldq.LT.n ) .OR. ldq.LT.1 )
THEN
291 ELSE IF( ( ilz .AND. ldz.LT.n ) .OR. ldz.LT.1 )
THEN
295 CALL xerbla(
'CGGHRD', -info )
302 $
CALL claset(
'Full', n, n, czero, cone, q, ldq )
304 $
CALL claset(
'Full', n, n, czero, cone, z, ldz )
313 DO 20 jcol = 1, n - 1
314 DO 10 jrow = jcol + 1, n
315 b( jrow, jcol ) = czero
321 DO 40 jcol = ilo, ihi - 2
323 DO 30 jrow = ihi, jcol + 2, -1
327 ctemp = a( jrow-1, jcol )
328 CALL clartg( ctemp, a( jrow, jcol ), c, s,
329 $ a( jrow-1, jcol ) )
330 a( jrow, jcol ) = czero
331 CALL crot( n-jcol, a( jrow-1, jcol+1 ), lda,
332 $ a( jrow, jcol+1 ), lda, c, s )
333 CALL crot( n+2-jrow, b( jrow-1, jrow-1 ), ldb,
334 $ b( jrow, jrow-1 ), ldb, c, s )
336 $
CALL crot( n, q( 1, jrow-1 ), 1, q( 1, jrow ), 1, c,
341 ctemp = b( jrow, jrow )
342 CALL clartg( ctemp, b( jrow, jrow-1 ), c, s,
344 b( jrow, jrow-1 ) = czero
345 CALL crot( ihi, a( 1, jrow ), 1, a( 1, jrow-1 ), 1, c,
347 CALL crot( jrow-1, b( 1, jrow ), 1, b( 1, jrow-1 ), 1, c,
350 $
CALL crot( n, z( 1, jrow ), 1, z( 1, jrow-1 ), 1, c,
subroutine cgghrd(compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, info)
CGGHRD