205 SUBROUTINE dgghrd( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, Q,
206 $ LDQ, Z, LDZ, INFO )
213 CHARACTER COMPQ, COMPZ
214 INTEGER IHI, ILO, INFO, LDA, LDB, LDQ, LDZ, N
217 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
224 DOUBLE PRECISION ONE, ZERO
225 parameter( one = 1.0d+0, zero = 0.0d+0 )
229 INTEGER ICOMPQ, ICOMPZ, JCOL, JROW
230 DOUBLE PRECISION C, S, TEMP
246 IF( lsame( compq,
'N' ) )
THEN
249 ELSE IF( lsame( compq,
'V' ) )
THEN
252 ELSE IF( lsame( compq,
'I' ) )
THEN
261 IF( lsame( compz,
'N' ) )
THEN
264 ELSE IF( lsame( compz,
'V' ) )
THEN
267 ELSE IF( lsame( compz,
'I' ) )
THEN
277 IF( icompq.LE.0 )
THEN
279 ELSE IF( icompz.LE.0 )
THEN
281 ELSE IF( n.LT.0 )
THEN
283 ELSE IF( ilo.LT.1 )
THEN
285 ELSE IF( ihi.GT.n .OR. ihi.LT.ilo-1 )
THEN
287 ELSE IF( lda.LT.max( 1, n ) )
THEN
289 ELSE IF( ldb.LT.max( 1, n ) )
THEN
291 ELSE IF( ( ilq .AND. ldq.LT.n ) .OR. ldq.LT.1 )
THEN
293 ELSE IF( ( ilz .AND. ldz.LT.n ) .OR. ldz.LT.1 )
THEN
297 CALL xerbla(
'DGGHRD', -info )
304 $
CALL dlaset(
'Full', n, n, zero, one, q, ldq )
306 $
CALL dlaset(
'Full', n, n, zero, one, z, ldz )
315 DO 20 jcol = 1, n - 1
316 DO 10 jrow = jcol + 1, n
317 b( jrow, jcol ) = zero
323 DO 40 jcol = ilo, ihi - 2
325 DO 30 jrow = ihi, jcol + 2, -1
329 temp = a( jrow-1, jcol )
330 CALL dlartg( temp, a( jrow, jcol ), c, s,
331 $ a( jrow-1, jcol ) )
332 a( jrow, jcol ) = zero
333 CALL drot( n-jcol, a( jrow-1, jcol+1 ), lda,
334 $ a( jrow, jcol+1 ), lda, c, s )
335 CALL drot( n+2-jrow, b( jrow-1, jrow-1 ), ldb,
336 $ b( jrow, jrow-1 ), ldb, c, s )
338 $
CALL drot( n, q( 1, jrow-1 ), 1, q( 1, jrow ), 1, c, s )
342 temp = b( jrow, jrow )
343 CALL dlartg( temp, b( jrow, jrow-1 ), c, s,
345 b( jrow, jrow-1 ) = zero
346 CALL drot( ihi, a( 1, jrow ), 1, a( 1, jrow-1 ), 1, c, s )
347 CALL drot( jrow-1, b( 1, jrow ), 1, b( 1, jrow-1 ), 1, c,
350 $
CALL drot( n, z( 1, jrow ), 1, z( 1, jrow-1 ), 1, c, s )
subroutine xerbla(srname, info)
subroutine dgghrd(compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, info)
DGGHRD
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT