169 SUBROUTINE slaqz2( ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA,
171 $ LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ )
175 LOGICAL,
INTENT( IN ) :: ILQ, ILZ
176 INTEGER,
INTENT( IN ) :: K, LDA, LDB, LDQ, LDZ, ISTARTM, ISTOPM,
177 $ nq, nz, qstart, zstart, ihi
178 REAL :: A( LDA, * ), B( LDB, * ), Q( LDQ, * ), Z( LDZ, * )
181 REAL :: ZERO, ONE, HALF
182 PARAMETER( ZERO = 0.0, one = 1.0, half = 0.5 )
185 REAL :: H( 2, 3 ), C1, S1, C2, S2, TEMP
190 IF( k+2 .EQ. ihi )
THEN
192 h = b( ihi-1:ihi, ihi-2:ihi )
194 CALL slartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
197 CALL srot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
199 CALL slartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
200 CALL srot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
201 CALL slartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
203 CALL srot( ihi-istartm+1, b( istartm, ihi ), 1, b( istartm,
204 $ ihi-1 ), 1, c1, s1 )
205 CALL srot( ihi-istartm+1, b( istartm, ihi-1 ), 1,
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,
214 $ ihi-2 ), 1, c2, s2 )
216 CALL srot( nz, z( 1, ihi-zstart+1 ), 1, z( 1,
219 CALL srot( nz, z( 1, ihi-1-zstart+1 ), 1, z( 1,
220 $ ihi-2-zstart+1 ), 1, c2, s2 )
223 CALL slartg( a( ihi-1, ihi-2 ), a( ihi, ihi-2 ), c1, s1,
225 a( ihi-1, ihi-2 ) = temp
226 a( ihi, ihi-2 ) = zero
227 CALL srot( istopm-ihi+2, a( ihi-1, ihi-1 ), lda, a( ihi,
228 $ ihi-1 ), lda, c1, s1 )
229 CALL srot( istopm-ihi+2, b( ihi-1, ihi-1 ), ldb, b( ihi,
230 $ ihi-1 ), ldb, c1, s1 )
232 CALL srot( nq, q( 1, ihi-1-qstart+1 ), 1, q( 1,
237 CALL slartg( b( ihi, ihi ), b( ihi, ihi-1 ), c1, s1, temp )
239 b( ihi, ihi-1 ) = zero
240 CALL srot( ihi-istartm, b( istartm, ihi ), 1, b( istartm,
241 $ ihi-1 ), 1, c1, s1 )
242 CALL srot( ihi-istartm+1, a( istartm, ihi ), 1, a( istartm,
243 $ ihi-1 ), 1, c1, s1 )
245 CALL srot( nz, z( 1, ihi-zstart+1 ), 1, z( 1,
254 h = b( k+1:k+2, k:k+2 )
258 CALL slartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
261 CALL srot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
265 CALL slartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
266 CALL srot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
267 CALL slartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
271 CALL srot( k+3-istartm+1, a( istartm, k+2 ), 1, a( istartm,
273 CALL srot( k+3-istartm+1, a( istartm, k+1 ), 1, a( istartm,
275 CALL srot( k+2-istartm+1, b( istartm, k+2 ), 1, b( istartm,
277 CALL srot( k+2-istartm+1, b( istartm, k+1 ), 1, b( istartm,
280 CALL srot( nz, z( 1, k+2-zstart+1 ), 1, z( 1, k+1-zstart+
282 CALL srot( nz, z( 1, k+1-zstart+1 ), 1, z( 1,
291 CALL slartg( a( k+2, k ), a( k+3, k ), c1, s1, temp )
294 CALL slartg( a( k+1, k ), a( k+2, k ), c2, s2, temp )
300 CALL srot( istopm-k, a( k+2, k+1 ), lda, a( k+3, k+1 ), lda,
302 CALL srot( istopm-k, a( k+1, k+1 ), lda, a( k+2, k+1 ), lda,
305 CALL srot( istopm-k, b( k+2, k+1 ), ldb, b( k+3, k+1 ), ldb,
307 CALL srot( istopm-k, b( k+1, k+1 ), ldb, b( k+2, k+1 ), ldb,
310 CALL srot( nq, q( 1, k+2-qstart+1 ), 1, q( 1, k+3-qstart+
312 CALL srot( nq, q( 1, k+1-qstart+1 ), 1, q( 1, k+2-qstart+