171 SUBROUTINE slaqz2( ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA, B,
172 $ LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ )
176 LOGICAL,
INTENT( IN ) :: ILQ, ILZ
177 INTEGER,
INTENT( IN ) :: K, LDA, LDB, LDQ, LDZ, ISTARTM, ISTOPM,
178 $ nq, nz, qstart, zstart, ihi
179 REAL :: A( LDA, * ), B( LDB, * ), Q( LDQ, * ), Z( LDZ, * )
182 REAL :: ZERO, ONE, HALF
183 parameter( zero = 0.0, one = 1.0, half = 0.5 )
186 REAL :: H( 2, 3 ), C1, S1, C2, S2, TEMP
191 IF( k+2 .EQ. ihi )
THEN
193 h = b( ihi-1:ihi, ihi-2:ihi )
195 CALL slartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
198 CALL srot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
200 CALL slartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
201 CALL srot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
202 CALL slartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
204 CALL srot( ihi-istartm+1, b( istartm, ihi ), 1, b( istartm,
205 $ ihi-1 ), 1, c1, s1 )
206 CALL srot( ihi-istartm+1, b( istartm, ihi-1 ), 1, b( istartm,
207 $ ihi-2 ), 1, c2, s2 )
208 b( ihi-1, ihi-2 ) = zero
209 b( ihi, ihi-2 ) = zero
210 CALL srot( ihi-istartm+1, a( istartm, ihi ), 1, a( istartm,
211 $ ihi-1 ), 1, c1, s1 )
212 CALL srot( ihi-istartm+1, a( istartm, ihi-1 ), 1, a( istartm,
213 $ ihi-2 ), 1, c2, s2 )
215 CALL srot( nz, z( 1, ihi-zstart+1 ), 1, z( 1, ihi-1-zstart+
217 CALL srot( nz, z( 1, ihi-1-zstart+1 ), 1, z( 1,
218 $ ihi-2-zstart+1 ), 1, c2, s2 )
221 CALL slartg( a( ihi-1, ihi-2 ), a( ihi, ihi-2 ), c1, s1,
223 a( ihi-1, ihi-2 ) = temp
224 a( ihi, ihi-2 ) = zero
225 CALL srot( istopm-ihi+2, a( ihi-1, ihi-1 ), lda, a( ihi,
226 $ ihi-1 ), lda, c1, s1 )
227 CALL srot( istopm-ihi+2, b( ihi-1, ihi-1 ), ldb, b( ihi,
228 $ ihi-1 ), ldb, c1, s1 )
230 CALL srot( nq, q( 1, ihi-1-qstart+1 ), 1, q( 1, ihi-qstart+
234 CALL slartg( b( ihi, ihi ), b( ihi, ihi-1 ), c1, s1, temp )
236 b( ihi, ihi-1 ) = zero
237 CALL srot( ihi-istartm, b( istartm, ihi ), 1, b( istartm,
238 $ ihi-1 ), 1, c1, s1 )
239 CALL srot( ihi-istartm+1, a( istartm, ihi ), 1, a( istartm,
240 $ ihi-1 ), 1, c1, s1 )
242 CALL srot( nz, z( 1, ihi-zstart+1 ), 1, z( 1, ihi-1-zstart+
250 h = b( k+1:k+2, k:k+2 )
254 CALL slartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
257 CALL srot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
261 CALL slartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
262 CALL srot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
263 CALL slartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
267 CALL srot( k+3-istartm+1, a( istartm, k+2 ), 1, a( istartm,
269 CALL srot( k+3-istartm+1, a( istartm, k+1 ), 1, a( istartm,
271 CALL srot( k+2-istartm+1, b( istartm, k+2 ), 1, b( istartm,
273 CALL srot( k+2-istartm+1, b( istartm, k+1 ), 1, b( istartm,
276 CALL srot( nz, z( 1, k+2-zstart+1 ), 1, z( 1, k+1-zstart+
278 CALL srot( nz, z( 1, k+1-zstart+1 ), 1, z( 1, k-zstart+1 ),
286 CALL slartg( a( k+2, k ), a( k+3, k ), c1, s1, temp )
289 CALL slartg( a( k+1, k ), a( k+2, k ), c2, s2, temp )
295 CALL srot( istopm-k, a( k+2, k+1 ), lda, a( k+3, k+1 ), lda,
297 CALL srot( istopm-k, a( k+1, k+1 ), lda, a( k+2, k+1 ), lda,
300 CALL srot( istopm-k, b( k+2, k+1 ), ldb, b( k+3, k+1 ), ldb,
302 CALL srot( istopm-k, b( k+1, k+1 ), ldb, b( k+2, k+1 ), ldb,
305 CALL srot( nq, q( 1, k+2-qstart+1 ), 1, q( 1, k+3-qstart+
307 CALL srot( nq, q( 1, k+1-qstart+1 ), 1, q( 1, k+2-qstart+
subroutine slaqz2(ilq, ilz, k, istartm, istopm, ihi, a, lda, b, ldb, nq, qstart, q, ldq, nz, zstart, z, ldz)
SLAQZ2
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT