172 SUBROUTINE dlaqz2( ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA, B,
173 $ LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ )
177 LOGICAL,
INTENT( IN ) :: ILQ, ILZ
178 INTEGER,
INTENT( IN ) :: K, LDA, LDB, LDQ, LDZ, ISTARTM, ISTOPM,
179 $ nq, nz, qstart, zstart, ihi
180 DOUBLE PRECISION :: A( LDA, * ), B( LDB, * ), Q( LDQ, * ), Z( LDZ,
184 DOUBLE PRECISION :: ZERO, ONE, HALF
185 parameter( zero = 0.0d0, one = 1.0d0, half = 0.5d0 )
188 DOUBLE PRECISION :: H( 2, 3 ), C1, S1, C2, S2, TEMP
193 IF( k+2 .EQ. ihi )
THEN
195 h = b( ihi-1:ihi, ihi-2:ihi )
197 CALL dlartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
200 CALL drot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
202 CALL dlartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
203 CALL drot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
204 CALL dlartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
206 CALL drot( ihi-istartm+1, b( istartm, ihi ), 1, b( istartm,
207 $ ihi-1 ), 1, c1, s1 )
208 CALL drot( ihi-istartm+1, b( istartm, ihi-1 ), 1, b( istartm,
209 $ ihi-2 ), 1, c2, s2 )
210 b( ihi-1, ihi-2 ) = zero
211 b( ihi, ihi-2 ) = zero
212 CALL drot( ihi-istartm+1, a( istartm, ihi ), 1, a( istartm,
213 $ ihi-1 ), 1, c1, s1 )
214 CALL drot( ihi-istartm+1, a( istartm, ihi-1 ), 1, a( istartm,
215 $ ihi-2 ), 1, c2, s2 )
217 CALL drot( nz, z( 1, ihi-zstart+1 ), 1, z( 1, ihi-1-zstart+
219 CALL drot( nz, z( 1, ihi-1-zstart+1 ), 1, z( 1,
220 $ ihi-2-zstart+1 ), 1, c2, s2 )
223 CALL dlartg( 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 drot( istopm-ihi+2, a( ihi-1, ihi-1 ), lda, a( ihi,
228 $ ihi-1 ), lda, c1, s1 )
229 CALL drot( istopm-ihi+2, b( ihi-1, ihi-1 ), ldb, b( ihi,
230 $ ihi-1 ), ldb, c1, s1 )
232 CALL drot( nq, q( 1, ihi-1-qstart+1 ), 1, q( 1, ihi-qstart+
236 CALL dlartg( b( ihi, ihi ), b( ihi, ihi-1 ), c1, s1, temp )
238 b( ihi, ihi-1 ) = zero
239 CALL drot( ihi-istartm, b( istartm, ihi ), 1, b( istartm,
240 $ ihi-1 ), 1, c1, s1 )
241 CALL drot( ihi-istartm+1, a( istartm, ihi ), 1, a( istartm,
242 $ ihi-1 ), 1, c1, s1 )
244 CALL drot( nz, z( 1, ihi-zstart+1 ), 1, z( 1, ihi-1-zstart+
252 h = b( k+1:k+2, k:k+2 )
256 CALL dlartg( h( 1, 1 ), h( 2, 1 ), c1, s1, temp )
259 CALL drot( 2, h( 1, 2 ), 2, h( 2, 2 ), 2, c1, s1 )
263 CALL dlartg( h( 2, 3 ), h( 2, 2 ), c1, s1, temp )
264 CALL drot( 1, h( 1, 3 ), 1, h( 1, 2 ), 1, c1, s1 )
265 CALL dlartg( h( 1, 2 ), h( 1, 1 ), c2, s2, temp )
269 CALL drot( k+3-istartm+1, a( istartm, k+2 ), 1, a( istartm,
271 CALL drot( k+3-istartm+1, a( istartm, k+1 ), 1, a( istartm,
273 CALL drot( k+2-istartm+1, b( istartm, k+2 ), 1, b( istartm,
275 CALL drot( k+2-istartm+1, b( istartm, k+1 ), 1, b( istartm,
278 CALL drot( nz, z( 1, k+2-zstart+1 ), 1, z( 1, k+1-zstart+
280 CALL drot( nz, z( 1, k+1-zstart+1 ), 1, z( 1, k-zstart+1 ),
288 CALL dlartg( a( k+2, k ), a( k+3, k ), c1, s1, temp )
291 CALL dlartg( a( k+1, k ), a( k+2, k ), c2, s2, temp )
297 CALL drot( istopm-k, a( k+2, k+1 ), lda, a( k+3, k+1 ), lda,
299 CALL drot( istopm-k, a( k+1, k+1 ), lda, a( k+2, k+1 ), lda,
302 CALL drot( istopm-k, b( k+2, k+1 ), ldb, b( k+3, k+1 ), ldb,
304 CALL drot( istopm-k, b( k+1, k+1 ), ldb, b( k+2, k+1 ), ldb,
307 CALL drot( nq, q( 1, k+2-qstart+1 ), 1, q( 1, k+3-qstart+
309 CALL drot( nq, q( 1, k+1-qstart+1 ), 1, q( 1, k+2-qstart+
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
subroutine drot(N, DX, INCX, DY, INCY, C, S)
DROT
subroutine dlaqz2(ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA, B, LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ)
DLAQZ2