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