LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlaqr1.f
Go to the documentation of this file.
1*> \brief \b DLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> \htmlonly
9*> Download DLAQR1 + dependencies
10*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaqr1.f">
11*> [TGZ]</a>
12*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaqr1.f">
13*> [ZIP]</a>
14*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaqr1.f">
15*> [TXT]</a>
16*> \endhtmlonly
17*
18* Definition:
19* ===========
20*
21* SUBROUTINE DLAQR1( N, H, LDH, SR1, SI1, SR2, SI2, V )
22*
23* .. Scalar Arguments ..
24* DOUBLE PRECISION SI1, SI2, SR1, SR2
25* INTEGER LDH, N
26* ..
27* .. Array Arguments ..
28* DOUBLE PRECISION H( LDH, * ), V( * )
29* ..
30*
31*
32*> \par Purpose:
33* =============
34*>
35*> \verbatim
36*>
37*> Given a 2-by-2 or 3-by-3 matrix H, DLAQR1 sets v to a
38*> scalar multiple of the first column of the product
39*>
40*> (*) K = (H - (sr1 + i*si1)*I)*(H - (sr2 + i*si2)*I)
41*>
42*> scaling to avoid overflows and most underflows. It
43*> is assumed that either
44*>
45*> 1) sr1 = sr2 and si1 = -si2
46*> or
47*> 2) si1 = si2 = 0.
48*>
49*> This is useful for starting double implicit shift bulges
50*> in the QR algorithm.
51*> \endverbatim
52*
53* Arguments:
54* ==========
55*
56*> \param[in] N
57*> \verbatim
58*> N is INTEGER
59*> Order of the matrix H. N must be either 2 or 3.
60*> \endverbatim
61*>
62*> \param[in] H
63*> \verbatim
64*> H is DOUBLE PRECISION array, dimension (LDH,N)
65*> The 2-by-2 or 3-by-3 matrix H in (*).
66*> \endverbatim
67*>
68*> \param[in] LDH
69*> \verbatim
70*> LDH is INTEGER
71*> The leading dimension of H as declared in
72*> the calling procedure. LDH >= N
73*> \endverbatim
74*>
75*> \param[in] SR1
76*> \verbatim
77*> SR1 is DOUBLE PRECISION
78*> \endverbatim
79*>
80*> \param[in] SI1
81*> \verbatim
82*> SI1 is DOUBLE PRECISION
83*> \endverbatim
84*>
85*> \param[in] SR2
86*> \verbatim
87*> SR2 is DOUBLE PRECISION
88*> \endverbatim
89*>
90*> \param[in] SI2
91*> \verbatim
92*> SI2 is DOUBLE PRECISION
93*> The shifts in (*).
94*> \endverbatim
95*>
96*> \param[out] V
97*> \verbatim
98*> V is DOUBLE PRECISION array, dimension (N)
99*> A scalar multiple of the first column of the
100*> matrix K in (*).
101*> \endverbatim
102*
103* Authors:
104* ========
105*
106*> \author Univ. of Tennessee
107*> \author Univ. of California Berkeley
108*> \author Univ. of Colorado Denver
109*> \author NAG Ltd.
110*
111*> \ingroup laqr1
112*
113*> \par Contributors:
114* ==================
115*>
116*> Karen Braman and Ralph Byers, Department of Mathematics,
117*> University of Kansas, USA
118*>
119* =====================================================================
120 SUBROUTINE dlaqr1( N, H, LDH, SR1, SI1, SR2, SI2, V )
121*
122* -- LAPACK auxiliary routine --
123* -- LAPACK is a software package provided by Univ. of Tennessee, --
124* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125*
126* .. Scalar Arguments ..
127 DOUBLE PRECISION SI1, SI2, SR1, SR2
128 INTEGER LDH, N
129* ..
130* .. Array Arguments ..
131 DOUBLE PRECISION H( LDH, * ), V( * )
132* ..
133*
134* ================================================================
135*
136* .. Parameters ..
137 DOUBLE PRECISION ZERO
138 parameter( zero = 0.0d0 )
139* ..
140* .. Local Scalars ..
141 DOUBLE PRECISION H21S, H31S, S
142* ..
143* .. Intrinsic Functions ..
144 INTRINSIC abs
145* ..
146* .. Executable Statements ..
147*
148* Quick return if possible
149*
150 IF( n.NE.2 .AND. n.NE.3 ) THEN
151 RETURN
152 END IF
153*
154 IF( n.EQ.2 ) THEN
155 s = abs( h( 1, 1 )-sr2 ) + abs( si2 ) + abs( h( 2, 1 ) )
156 IF( s.EQ.zero ) THEN
157 v( 1 ) = zero
158 v( 2 ) = zero
159 ELSE
160 h21s = h( 2, 1 ) / s
161 v( 1 ) = h21s*h( 1, 2 ) + ( h( 1, 1 )-sr1 )*
162 $ ( ( h( 1, 1 )-sr2 ) / s ) - si1*( si2 / s )
163 v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-sr1-sr2 )
164 END IF
165 ELSE
166 s = abs( h( 1, 1 )-sr2 ) + abs( si2 ) + abs( h( 2, 1 ) ) +
167 $ abs( h( 3, 1 ) )
168 IF( s.EQ.zero ) THEN
169 v( 1 ) = zero
170 v( 2 ) = zero
171 v( 3 ) = zero
172 ELSE
173 h21s = h( 2, 1 ) / s
174 h31s = h( 3, 1 ) / s
175 v( 1 ) = ( h( 1, 1 )-sr1 )*( ( h( 1, 1 )-sr2 ) / s ) -
176 $ si1*( si2 / s ) + h( 1, 2 )*h21s + h( 1, 3 )*h31s
177 v( 2 ) = h21s*( h( 1, 1 )+h( 2, 2 )-sr1-sr2 ) +
178 $ h( 2, 3 )*h31s
179 v( 3 ) = h31s*( h( 1, 1 )+h( 3, 3 )-sr1-sr2 ) +
180 $ h21s*h( 3, 2 )
181 END IF
182 END IF
183 END
subroutine dlaqr1(n, h, ldh, sr1, si1, sr2, si2, v)
DLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and spe...
Definition dlaqr1.f:121