205 SUBROUTINE sgghrd( 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 REAL A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
225 parameter( one = 1.0e+0, zero = 0.0e+0 )
229 INTEGER ICOMPQ, ICOMPZ, JCOL, JROW
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(
'SGGHRD', -info )
304 $
CALL slaset(
'Full', n, n, zero, one, q, ldq )
306 $
CALL slaset(
'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 slartg( temp, a( jrow, jcol ), c, s,
331 $ a( jrow-1, jcol ) )
332 a( jrow, jcol ) = zero
333 CALL srot( n-jcol, a( jrow-1, jcol+1 ), lda,
334 $ a( jrow, jcol+1 ), lda, c, s )
335 CALL srot( n+2-jrow, b( jrow-1, jrow-1 ), ldb,
336 $ b( jrow, jrow-1 ), ldb, c, s )
338 $
CALL srot( n, q( 1, jrow-1 ), 1, q( 1, jrow ), 1, c, s )
342 temp = b( jrow, jrow )
343 CALL slartg( temp, b( jrow, jrow-1 ), c, s,
345 b( jrow, jrow-1 ) = zero
346 CALL srot( ihi, a( 1, jrow ), 1, a( 1, jrow-1 ), 1, c, s )
347 CALL srot( jrow-1, b( 1, jrow ), 1, b( 1, jrow-1 ), 1, c,
350 $
CALL srot( n, z( 1, jrow ), 1, z( 1, jrow-1 ), 1, c, s )
subroutine xerbla(srname, info)
subroutine sgghrd(compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, info)
SGGHRD
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT