LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlaqr2.f
Go to the documentation of this file.
1*> \brief \b DLAQR2 performs the orthogonal similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation).
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DLAQR2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaqr2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaqr2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaqr2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DLAQR2( WANTT, WANTZ, N, KTOP, KBOT, NW, H, LDH, ILOZ,
20* IHIZ, Z, LDZ, NS, ND, SR, SI, V, LDV, NH, T,
21* LDT, NV, WV, LDWV, WORK, LWORK )
22*
23* .. Scalar Arguments ..
24* INTEGER IHIZ, ILOZ, KBOT, KTOP, LDH, LDT, LDV, LDWV,
25* $ LDZ, LWORK, N, ND, NH, NS, NV, NW
26* LOGICAL WANTT, WANTZ
27* ..
28* .. Array Arguments ..
29* DOUBLE PRECISION H( LDH, * ), SI( * ), SR( * ), T( LDT, * ),
30* $ V( LDV, * ), WORK( * ), WV( LDWV, * ),
31* $ Z( LDZ, * )
32* ..
33*
34*
35*> \par Purpose:
36* =============
37*>
38*> \verbatim
39*>
40*> DLAQR2 is identical to DLAQR3 except that it avoids
41*> recursion by calling DLAHQR instead of DLAQR4.
42*>
43*> Aggressive early deflation:
44*>
45*> This subroutine accepts as input an upper Hessenberg matrix
46*> H and performs an orthogonal similarity transformation
47*> designed to detect and deflate fully converged eigenvalues from
48*> a trailing principal submatrix. On output H has been over-
49*> written by a new Hessenberg matrix that is a perturbation of
50*> an orthogonal similarity transformation of H. It is to be
51*> hoped that the final version of H has many zero subdiagonal
52*> entries.
53*> \endverbatim
54*
55* Arguments:
56* ==========
57*
58*> \param[in] WANTT
59*> \verbatim
60*> WANTT is LOGICAL
61*> If .TRUE., then the Hessenberg matrix H is fully updated
62*> so that the quasi-triangular Schur factor may be
63*> computed (in cooperation with the calling subroutine).
64*> If .FALSE., then only enough of H is updated to preserve
65*> the eigenvalues.
66*> \endverbatim
67*>
68*> \param[in] WANTZ
69*> \verbatim
70*> WANTZ is LOGICAL
71*> If .TRUE., then the orthogonal matrix Z is updated so
72*> so that the orthogonal Schur factor may be computed
73*> (in cooperation with the calling subroutine).
74*> If .FALSE., then Z is not referenced.
75*> \endverbatim
76*>
77*> \param[in] N
78*> \verbatim
79*> N is INTEGER
80*> The order of the matrix H and (if WANTZ is .TRUE.) the
81*> order of the orthogonal matrix Z.
82*> \endverbatim
83*>
84*> \param[in] KTOP
85*> \verbatim
86*> KTOP is INTEGER
87*> It is assumed that either KTOP = 1 or H(KTOP,KTOP-1)=0.
88*> KBOT and KTOP together determine an isolated block
89*> along the diagonal of the Hessenberg matrix.
90*> \endverbatim
91*>
92*> \param[in] KBOT
93*> \verbatim
94*> KBOT is INTEGER
95*> It is assumed without a check that either
96*> KBOT = N or H(KBOT+1,KBOT)=0. KBOT and KTOP together
97*> determine an isolated block along the diagonal of the
98*> Hessenberg matrix.
99*> \endverbatim
100*>
101*> \param[in] NW
102*> \verbatim
103*> NW is INTEGER
104*> Deflation window size. 1 <= NW <= (KBOT-KTOP+1).
105*> \endverbatim
106*>
107*> \param[in,out] H
108*> \verbatim
109*> H is DOUBLE PRECISION array, dimension (LDH,N)
110*> On input the initial N-by-N section of H stores the
111*> Hessenberg matrix undergoing aggressive early deflation.
112*> On output H has been transformed by an orthogonal
113*> similarity transformation, perturbed, and the returned
114*> to Hessenberg form that (it is to be hoped) has some
115*> zero subdiagonal entries.
116*> \endverbatim
117*>
118*> \param[in] LDH
119*> \verbatim
120*> LDH is INTEGER
121*> Leading dimension of H just as declared in the calling
122*> subroutine. N <= LDH
123*> \endverbatim
124*>
125*> \param[in] ILOZ
126*> \verbatim
127*> ILOZ is INTEGER
128*> \endverbatim
129*>
130*> \param[in] IHIZ
131*> \verbatim
132*> IHIZ is INTEGER
133*> Specify the rows of Z to which transformations must be
134*> applied if WANTZ is .TRUE.. 1 <= ILOZ <= IHIZ <= N.
135*> \endverbatim
136*>
137*> \param[in,out] Z
138*> \verbatim
139*> Z is DOUBLE PRECISION array, dimension (LDZ,N)
140*> IF WANTZ is .TRUE., then on output, the orthogonal
141*> similarity transformation mentioned above has been
142*> accumulated into Z(ILOZ:IHIZ,ILOZ:IHIZ) from the right.
143*> If WANTZ is .FALSE., then Z is unreferenced.
144*> \endverbatim
145*>
146*> \param[in] LDZ
147*> \verbatim
148*> LDZ is INTEGER
149*> The leading dimension of Z just as declared in the
150*> calling subroutine. 1 <= LDZ.
151*> \endverbatim
152*>
153*> \param[out] NS
154*> \verbatim
155*> NS is INTEGER
156*> The number of unconverged (ie approximate) eigenvalues
157*> returned in SR and SI that may be used as shifts by the
158*> calling subroutine.
159*> \endverbatim
160*>
161*> \param[out] ND
162*> \verbatim
163*> ND is INTEGER
164*> The number of converged eigenvalues uncovered by this
165*> subroutine.
166*> \endverbatim
167*>
168*> \param[out] SR
169*> \verbatim
170*> SR is DOUBLE PRECISION array, dimension (KBOT)
171*> \endverbatim
172*>
173*> \param[out] SI
174*> \verbatim
175*> SI is DOUBLE PRECISION array, dimension (KBOT)
176*> On output, the real and imaginary parts of approximate
177*> eigenvalues that may be used for shifts are stored in
178*> SR(KBOT-ND-NS+1) through SR(KBOT-ND) and
179*> SI(KBOT-ND-NS+1) through SI(KBOT-ND), respectively.
180*> The real and imaginary parts of converged eigenvalues
181*> are stored in SR(KBOT-ND+1) through SR(KBOT) and
182*> SI(KBOT-ND+1) through SI(KBOT), respectively.
183*> \endverbatim
184*>
185*> \param[out] V
186*> \verbatim
187*> V is DOUBLE PRECISION array, dimension (LDV,NW)
188*> An NW-by-NW work array.
189*> \endverbatim
190*>
191*> \param[in] LDV
192*> \verbatim
193*> LDV is INTEGER
194*> The leading dimension of V just as declared in the
195*> calling subroutine. NW <= LDV
196*> \endverbatim
197*>
198*> \param[in] NH
199*> \verbatim
200*> NH is INTEGER
201*> The number of columns of T. NH >= NW.
202*> \endverbatim
203*>
204*> \param[out] T
205*> \verbatim
206*> T is DOUBLE PRECISION array, dimension (LDT,NW)
207*> \endverbatim
208*>
209*> \param[in] LDT
210*> \verbatim
211*> LDT is INTEGER
212*> The leading dimension of T just as declared in the
213*> calling subroutine. NW <= LDT
214*> \endverbatim
215*>
216*> \param[in] NV
217*> \verbatim
218*> NV is INTEGER
219*> The number of rows of work array WV available for
220*> workspace. NV >= NW.
221*> \endverbatim
222*>
223*> \param[out] WV
224*> \verbatim
225*> WV is DOUBLE PRECISION array, dimension (LDWV,NW)
226*> \endverbatim
227*>
228*> \param[in] LDWV
229*> \verbatim
230*> LDWV is INTEGER
231*> The leading dimension of W just as declared in the
232*> calling subroutine. NW <= LDV
233*> \endverbatim
234*>
235*> \param[out] WORK
236*> \verbatim
237*> WORK is DOUBLE PRECISION array, dimension (LWORK)
238*> On exit, WORK(1) is set to an estimate of the optimal value
239*> of LWORK for the given values of N, NW, KTOP and KBOT.
240*> \endverbatim
241*>
242*> \param[in] LWORK
243*> \verbatim
244*> LWORK is INTEGER
245*> The dimension of the work array WORK. LWORK = 2*NW
246*> suffices, but greater efficiency may result from larger
247*> values of LWORK.
248*>
249*> If LWORK = -1, then a workspace query is assumed; DLAQR2
250*> only estimates the optimal workspace size for the given
251*> values of N, NW, KTOP and KBOT. The estimate is returned
252*> in WORK(1). No error message related to LWORK is issued
253*> by XERBLA. Neither H nor Z are accessed.
254*> \endverbatim
255*
256* Authors:
257* ========
258*
259*> \author Univ. of Tennessee
260*> \author Univ. of California Berkeley
261*> \author Univ. of Colorado Denver
262*> \author NAG Ltd.
263*
264*> \ingroup laqr2
265*
266*> \par Contributors:
267* ==================
268*>
269*> Karen Braman and Ralph Byers, Department of Mathematics,
270*> University of Kansas, USA
271*>
272* =====================================================================
273 SUBROUTINE dlaqr2( WANTT, WANTZ, N, KTOP, KBOT, NW, H, LDH,
274 $ ILOZ,
275 $ IHIZ, Z, LDZ, NS, ND, SR, SI, V, LDV, NH, T,
276 $ LDT, NV, WV, LDWV, WORK, LWORK )
277*
278* -- LAPACK auxiliary routine --
279* -- LAPACK is a software package provided by Univ. of Tennessee, --
280* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
281*
282* .. Scalar Arguments ..
283 INTEGER IHIZ, ILOZ, KBOT, KTOP, LDH, LDT, LDV, LDWV,
284 $ LDZ, LWORK, N, ND, NH, NS, NV, NW
285 LOGICAL WANTT, WANTZ
286* ..
287* .. Array Arguments ..
288 DOUBLE PRECISION H( LDH, * ), SI( * ), SR( * ), T( LDT, * ),
289 $ V( LDV, * ), WORK( * ), WV( LDWV, * ),
290 $ Z( LDZ, * )
291* ..
292*
293* ================================================================
294* .. Parameters ..
295 DOUBLE PRECISION ZERO, ONE
296 PARAMETER ( ZERO = 0.0d0, one = 1.0d0 )
297* ..
298* .. Local Scalars ..
299 DOUBLE PRECISION AA, BB, BETA, CC, CS, DD, EVI, EVK, FOO, S,
300 $ SAFMAX, SAFMIN, SMLNUM, SN, TAU, ULP
301 INTEGER I, IFST, ILST, INFO, INFQR, J, JW, K, KCOL,
302 $ kend, kln, krow, kwtop, ltop, lwk1, lwk2,
303 $ lwkopt
304 LOGICAL BULGE, SORTED
305* ..
306* .. External Functions ..
307 DOUBLE PRECISION DLAMCH
308 EXTERNAL DLAMCH
309* ..
310* .. External Subroutines ..
311 EXTERNAL dcopy, dgehrd, dgemm, dlacpy,
312 $ dlahqr,
314* ..
315* .. Intrinsic Functions ..
316 INTRINSIC abs, dble, int, max, min, sqrt
317* ..
318* .. Executable Statements ..
319*
320* ==== Estimate optimal workspace. ====
321*
322 jw = min( nw, kbot-ktop+1 )
323 IF( jw.LE.2 ) THEN
324 lwkopt = 1
325 ELSE
326*
327* ==== Workspace query call to DGEHRD ====
328*
329 CALL dgehrd( jw, 1, jw-1, t, ldt, work, work, -1, info )
330 lwk1 = int( work( 1 ) )
331*
332* ==== Workspace query call to DORMHR ====
333*
334 CALL dormhr( 'R', 'N', jw, jw, 1, jw-1, t, ldt, work, v,
335 $ ldv,
336 $ work, -1, info )
337 lwk2 = int( work( 1 ) )
338*
339* ==== Optimal workspace ====
340*
341 lwkopt = jw + max( lwk1, lwk2 )
342 END IF
343*
344* ==== Quick return in case of workspace query. ====
345*
346 IF( lwork.EQ.-1 ) THEN
347 work( 1 ) = dble( lwkopt )
348 RETURN
349 END IF
350*
351* ==== Nothing to do ...
352* ... for an empty active block ... ====
353 ns = 0
354 nd = 0
355 work( 1 ) = one
356 IF( ktop.GT.kbot )
357 $ RETURN
358* ... nor for an empty deflation window. ====
359 IF( nw.LT.1 )
360 $ RETURN
361*
362* ==== Machine constants ====
363*
364 safmin = dlamch( 'SAFE MINIMUM' )
365 safmax = one / safmin
366 ulp = dlamch( 'PRECISION' )
367 smlnum = safmin*( dble( n ) / ulp )
368*
369* ==== Setup deflation window ====
370*
371 jw = min( nw, kbot-ktop+1 )
372 kwtop = kbot - jw + 1
373 IF( kwtop.EQ.ktop ) THEN
374 s = zero
375 ELSE
376 s = h( kwtop, kwtop-1 )
377 END IF
378*
379 IF( kbot.EQ.kwtop ) THEN
380*
381* ==== 1-by-1 deflation window: not much to do ====
382*
383 sr( kwtop ) = h( kwtop, kwtop )
384 si( kwtop ) = zero
385 ns = 1
386 nd = 0
387 IF( abs( s ).LE.max( smlnum, ulp*abs( h( kwtop, kwtop ) ) ) )
388 $ THEN
389 ns = 0
390 nd = 1
391 IF( kwtop.GT.ktop )
392 $ h( kwtop, kwtop-1 ) = zero
393 END IF
394 work( 1 ) = one
395 RETURN
396 END IF
397*
398* ==== Convert to spike-triangular form. (In case of a
399* . rare QR failure, this routine continues to do
400* . aggressive early deflation using that part of
401* . the deflation window that converged using INFQR
402* . here and there to keep track.) ====
403*
404 CALL dlacpy( 'U', jw, jw, h( kwtop, kwtop ), ldh, t, ldt )
405 CALL dcopy( jw-1, h( kwtop+1, kwtop ), ldh+1, t( 2, 1 ),
406 $ ldt+1 )
407*
408 CALL dlaset( 'A', jw, jw, zero, one, v, ldv )
409 CALL dlahqr( .true., .true., jw, 1, jw, t, ldt, sr( kwtop ),
410 $ si( kwtop ), 1, jw, v, ldv, infqr )
411*
412* ==== DTREXC needs a clean margin near the diagonal ====
413*
414 DO 10 j = 1, jw - 3
415 t( j+2, j ) = zero
416 t( j+3, j ) = zero
417 10 CONTINUE
418 IF( jw.GT.2 )
419 $ t( jw, jw-2 ) = zero
420*
421* ==== Deflation detection loop ====
422*
423 ns = jw
424 ilst = infqr + 1
425 20 CONTINUE
426 IF( ilst.LE.ns ) THEN
427 IF( ns.EQ.1 ) THEN
428 bulge = .false.
429 ELSE
430 bulge = t( ns, ns-1 ).NE.zero
431 END IF
432*
433* ==== Small spike tip test for deflation ====
434*
435 IF( .NOT.bulge ) THEN
436*
437* ==== Real eigenvalue ====
438*
439 foo = abs( t( ns, ns ) )
440 IF( foo.EQ.zero )
441 $ foo = abs( s )
442 IF( abs( s*v( 1, ns ) ).LE.max( smlnum, ulp*foo ) ) THEN
443*
444* ==== Deflatable ====
445*
446 ns = ns - 1
447 ELSE
448*
449* ==== Undeflatable. Move it up out of the way.
450* . (DTREXC can not fail in this case.) ====
451*
452 ifst = ns
453 CALL dtrexc( 'V', jw, t, ldt, v, ldv, ifst, ilst,
454 $ work,
455 $ info )
456 ilst = ilst + 1
457 END IF
458 ELSE
459*
460* ==== Complex conjugate pair ====
461*
462 foo = abs( t( ns, ns ) ) + sqrt( abs( t( ns, ns-1 ) ) )*
463 $ sqrt( abs( t( ns-1, ns ) ) )
464 IF( foo.EQ.zero )
465 $ foo = abs( s )
466 IF( max( abs( s*v( 1, ns ) ), abs( s*v( 1, ns-1 ) ) ).LE.
467 $ max( smlnum, ulp*foo ) ) THEN
468*
469* ==== Deflatable ====
470*
471 ns = ns - 2
472 ELSE
473*
474* ==== Undeflatable. Move them up out of the way.
475* . Fortunately, DTREXC does the right thing with
476* . ILST in case of a rare exchange failure. ====
477*
478 ifst = ns
479 CALL dtrexc( 'V', jw, t, ldt, v, ldv, ifst, ilst,
480 $ work,
481 $ info )
482 ilst = ilst + 2
483 END IF
484 END IF
485*
486* ==== End deflation detection loop ====
487*
488 GO TO 20
489 END IF
490*
491* ==== Return to Hessenberg form ====
492*
493 IF( ns.EQ.0 )
494 $ s = zero
495*
496 IF( ns.LT.jw ) THEN
497*
498* ==== sorting diagonal blocks of T improves accuracy for
499* . graded matrices. Bubble sort deals well with
500* . exchange failures. ====
501*
502 sorted = .false.
503 i = ns + 1
504 30 CONTINUE
505 IF( sorted )
506 $ GO TO 50
507 sorted = .true.
508*
509 kend = i - 1
510 i = infqr + 1
511 IF( i.EQ.ns ) THEN
512 k = i + 1
513 ELSE IF( t( i+1, i ).EQ.zero ) THEN
514 k = i + 1
515 ELSE
516 k = i + 2
517 END IF
518 40 CONTINUE
519 IF( k.LE.kend ) THEN
520 IF( k.EQ.i+1 ) THEN
521 evi = abs( t( i, i ) )
522 ELSE
523 evi = abs( t( i, i ) ) + sqrt( abs( t( i+1, i ) ) )*
524 $ sqrt( abs( t( i, i+1 ) ) )
525 END IF
526*
527 IF( k.EQ.kend ) THEN
528 evk = abs( t( k, k ) )
529 ELSE IF( t( k+1, k ).EQ.zero ) THEN
530 evk = abs( t( k, k ) )
531 ELSE
532 evk = abs( t( k, k ) ) + sqrt( abs( t( k+1, k ) ) )*
533 $ sqrt( abs( t( k, k+1 ) ) )
534 END IF
535*
536 IF( evi.GE.evk ) THEN
537 i = k
538 ELSE
539 sorted = .false.
540 ifst = i
541 ilst = k
542 CALL dtrexc( 'V', jw, t, ldt, v, ldv, ifst, ilst,
543 $ work,
544 $ info )
545 IF( info.EQ.0 ) THEN
546 i = ilst
547 ELSE
548 i = k
549 END IF
550 END IF
551 IF( i.EQ.kend ) THEN
552 k = i + 1
553 ELSE IF( t( i+1, i ).EQ.zero ) THEN
554 k = i + 1
555 ELSE
556 k = i + 2
557 END IF
558 GO TO 40
559 END IF
560 GO TO 30
561 50 CONTINUE
562 END IF
563*
564* ==== Restore shift/eigenvalue array from T ====
565*
566 i = jw
567 60 CONTINUE
568 IF( i.GE.infqr+1 ) THEN
569 IF( i.EQ.infqr+1 ) THEN
570 sr( kwtop+i-1 ) = t( i, i )
571 si( kwtop+i-1 ) = zero
572 i = i - 1
573 ELSE IF( t( i, i-1 ).EQ.zero ) THEN
574 sr( kwtop+i-1 ) = t( i, i )
575 si( kwtop+i-1 ) = zero
576 i = i - 1
577 ELSE
578 aa = t( i-1, i-1 )
579 cc = t( i, i-1 )
580 bb = t( i-1, i )
581 dd = t( i, i )
582 CALL dlanv2( aa, bb, cc, dd, sr( kwtop+i-2 ),
583 $ si( kwtop+i-2 ), sr( kwtop+i-1 ),
584 $ si( kwtop+i-1 ), cs, sn )
585 i = i - 2
586 END IF
587 GO TO 60
588 END IF
589*
590 IF( ns.LT.jw .OR. s.EQ.zero ) THEN
591 IF( ns.GT.1 .AND. s.NE.zero ) THEN
592*
593* ==== Reflect spike back into lower triangle ====
594*
595 CALL dcopy( ns, v, ldv, work, 1 )
596 beta = work( 1 )
597 CALL dlarfg( ns, beta, work( 2 ), 1, tau )
598*
599 CALL dlaset( 'L', jw-2, jw-2, zero, zero, t( 3, 1 ),
600 $ ldt )
601*
602 CALL dlarf1f( 'L', ns, jw, work, 1, tau, t, ldt,
603 $ work( jw+1 ) )
604 CALL dlarf1f( 'R', ns, ns, work, 1, tau, t, ldt,
605 $ work( jw+1 ) )
606 CALL dlarf1f( 'R', jw, ns, work, 1, tau, v, ldv,
607 $ work( jw+1 ) )
608*
609 CALL dgehrd( jw, 1, ns, t, ldt, work, work( jw+1 ),
610 $ lwork-jw, info )
611 END IF
612*
613* ==== Copy updated reduced window into place ====
614*
615 IF( kwtop.GT.1 )
616 $ h( kwtop, kwtop-1 ) = s*v( 1, 1 )
617 CALL dlacpy( 'U', jw, jw, t, ldt, h( kwtop, kwtop ), ldh )
618 CALL dcopy( jw-1, t( 2, 1 ), ldt+1, h( kwtop+1, kwtop ),
619 $ ldh+1 )
620*
621* ==== Accumulate orthogonal matrix in order update
622* . H and Z, if requested. ====
623*
624 IF( ns.GT.1 .AND. s.NE.zero )
625 $ CALL dormhr( 'R', 'N', jw, ns, 1, ns, t, ldt, work, v,
626 $ ldv,
627 $ work( jw+1 ), lwork-jw, info )
628*
629* ==== Update vertical slab in H ====
630*
631 IF( wantt ) THEN
632 ltop = 1
633 ELSE
634 ltop = ktop
635 END IF
636 DO 70 krow = ltop, kwtop - 1, nv
637 kln = min( nv, kwtop-krow )
638 CALL dgemm( 'N', 'N', kln, jw, jw, one, h( krow, kwtop ),
639 $ ldh, v, ldv, zero, wv, ldwv )
640 CALL dlacpy( 'A', kln, jw, wv, ldwv, h( krow, kwtop ),
641 $ ldh )
642 70 CONTINUE
643*
644* ==== Update horizontal slab in H ====
645*
646 IF( wantt ) THEN
647 DO 80 kcol = kbot + 1, n, nh
648 kln = min( nh, n-kcol+1 )
649 CALL dgemm( 'C', 'N', jw, kln, jw, one, v, ldv,
650 $ h( kwtop, kcol ), ldh, zero, t, ldt )
651 CALL dlacpy( 'A', jw, kln, t, ldt, h( kwtop, kcol ),
652 $ ldh )
653 80 CONTINUE
654 END IF
655*
656* ==== Update vertical slab in Z ====
657*
658 IF( wantz ) THEN
659 DO 90 krow = iloz, ihiz, nv
660 kln = min( nv, ihiz-krow+1 )
661 CALL dgemm( 'N', 'N', kln, jw, jw, one, z( krow,
662 $ kwtop ),
663 $ ldz, v, ldv, zero, wv, ldwv )
664 CALL dlacpy( 'A', kln, jw, wv, ldwv, z( krow, kwtop ),
665 $ ldz )
666 90 CONTINUE
667 END IF
668 END IF
669*
670* ==== Return the number of deflations ... ====
671*
672 nd = jw - ns
673*
674* ==== ... and the number of shifts. (Subtracting
675* . INFQR from the spike length takes care
676* . of the case of a rare QR failure while
677* . calculating eigenvalues of the deflation
678* . window.) ====
679*
680 ns = ns - infqr
681*
682* ==== Return optimal workspace. ====
683*
684 work( 1 ) = dble( lwkopt )
685*
686* ==== End of DLAQR2 ====
687*
688 END
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dgehrd(n, ilo, ihi, a, lda, tau, work, lwork, info)
DGEHRD
Definition dgehrd.f:166
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
Definition dgemm.f:188
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
Definition dlacpy.f:101
subroutine dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, info)
DLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix,...
Definition dlahqr.f:205
subroutine dlanv2(a, b, c, d, rt1r, rt1i, rt2r, rt2i, cs, sn)
DLANV2 computes the Schur factorization of a real 2-by-2 nonsymmetric matrix in standard form.
Definition dlanv2.f:125
subroutine dlaqr2(wantt, wantz, n, ktop, kbot, nw, h, ldh, iloz, ihiz, z, ldz, ns, nd, sr, si, v, ldv, nh, t, ldt, nv, wv, ldwv, work, lwork)
DLAQR2 performs the orthogonal similarity transformation of a Hessenberg matrix to detect and deflate...
Definition dlaqr2.f:277
subroutine dlarf1f(side, m, n, v, incv, tau, c, ldc, work)
DLARF1F applies an elementary reflector to a general rectangular
Definition dlarf1f.f:157
subroutine dlarfg(n, alpha, x, incx, tau)
DLARFG generates an elementary reflector (Householder matrix).
Definition dlarfg.f:104
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.
Definition dlaset.f:108
subroutine dtrexc(compq, n, t, ldt, q, ldq, ifst, ilst, work, info)
DTREXC
Definition dtrexc.f:146
subroutine dormhr(side, trans, m, n, ilo, ihi, a, lda, tau, c, ldc, work, lwork, info)
DORMHR
Definition dormhr.f:176