LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
slaqz1.f
Go to the documentation of this file.
1*> \brief \b SLAQZ1
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SLAQZ1 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaqz1.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaqz1.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaqz1.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SLAQZ1( A, LDA, B, LDB, SR1, SR2, SI, BETA1, BETA2,
20* $ V )
21* IMPLICIT NONE
22*
23* Arguments
24* INTEGER, INTENT( IN ) :: LDA, LDB
25* REAL, INTENT( IN ) :: A( LDA, * ), B( LDB, * ), SR1, SR2, SI,
26* $ BETA1, BETA2
27* REAL, INTENT( OUT ) :: V( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> Given a 3-by-3 matrix pencil (A,B), SLAQZ1 sets v to a
37*> scalar multiple of the first column of the product
38*>
39*> (*) K = (A - (beta2*sr2 - i*si)*B)*B^(-1)*(beta1*A - (sr2 + i*si2)*B)*B^(-1).
40*>
41*> It is assumed that either
42*>
43*> 1) sr1 = sr2
44*> or
45*> 2) si = 0.
46*>
47*> This is useful for starting double implicit shift bulges
48*> in the QZ algorithm.
49*> \endverbatim
50*
51*
52* Arguments:
53* ==========
54*
55*> \param[in] A
56*> \verbatim
57*> A is REAL array, dimension (LDA,N)
58*> The 3-by-3 matrix A in (*).
59*> \endverbatim
60*>
61*> \param[in] LDA
62*> \verbatim
63*> LDA is INTEGER
64*> The leading dimension of A as declared in
65*> the calling procedure.
66*> \endverbatim
67*
68*> \param[in] B
69*> \verbatim
70*> B is REAL array, dimension (LDB,N)
71*> The 3-by-3 matrix B in (*).
72*> \endverbatim
73*>
74*> \param[in] LDB
75*> \verbatim
76*> LDB is INTEGER
77*> The leading dimension of B as declared in
78*> the calling procedure.
79*> \endverbatim
80*>
81*> \param[in] SR1
82*> \verbatim
83*> SR1 is REAL
84*> \endverbatim
85*>
86*> \param[in] SR2
87*> \verbatim
88*> SR2 is REAL
89*> \endverbatim
90*>
91*> \param[in] SI
92*> \verbatim
93*> SI is REAL
94*> \endverbatim
95*>
96*> \param[in] BETA1
97*> \verbatim
98*> BETA1 is REAL
99*> \endverbatim
100*>
101*> \param[in] BETA2
102*> \verbatim
103*> BETA2 is REAL
104*> \endverbatim
105*>
106*> \param[out] V
107*> \verbatim
108*> V is REAL array, dimension (N)
109*> A scalar multiple of the first column of the
110*> matrix K in (*).
111*> \endverbatim
112*
113* Authors:
114* ========
115*
116*> \author Thijs Steel, KU Leuven
117*
118*> \date May 2020
119*
120*> \ingroup laqz1
121*>
122* =====================================================================
123 SUBROUTINE slaqz1( A, LDA, B, LDB, SR1, SR2, SI, BETA1, BETA2,
124 $ V )
125 IMPLICIT NONE
126*
127* Arguments
128 INTEGER, INTENT( IN ) :: LDA, LDB
129 REAL, INTENT( IN ) :: A( LDA, * ), B( LDB, * ), SR1, SR2, SI,
130 $ beta1, beta2
131 REAL, INTENT( OUT ) :: V( * )
132*
133* Parameters
134 REAL :: ZERO, ONE, HALF
135 parameter( zero = 0.0, one = 1.0, half = 0.5 )
136*
137* Local scalars
138 REAL :: W( 2 ), SAFMIN, SAFMAX, SCALE1, SCALE2
139*
140* External Functions
141 REAL, EXTERNAL :: SLAMCH
142 LOGICAL, EXTERNAL :: SISNAN
143*
144 safmin = slamch( 'SAFE MINIMUM' )
145 safmax = one/safmin
146*
147* Calculate first shifted vector
148*
149 w( 1 ) = beta1*a( 1, 1 )-sr1*b( 1, 1 )
150 w( 2 ) = beta1*a( 2, 1 )-sr1*b( 2, 1 )
151 scale1 = sqrt( abs( w( 1 ) ) ) * sqrt( abs( w( 2 ) ) )
152 IF( scale1 .GE. safmin .AND. scale1 .LE. safmax ) THEN
153 w( 1 ) = w( 1 )/scale1
154 w( 2 ) = w( 2 )/scale1
155 END IF
156*
157* Solve linear system
158*
159 w( 2 ) = w( 2 )/b( 2, 2 )
160 w( 1 ) = ( w( 1 )-b( 1, 2 )*w( 2 ) )/b( 1, 1 )
161 scale2 = sqrt( abs( w( 1 ) ) ) * sqrt( abs( w( 2 ) ) )
162 IF( scale2 .GE. safmin .AND. scale2 .LE. safmax ) THEN
163 w( 1 ) = w( 1 )/scale2
164 w( 2 ) = w( 2 )/scale2
165 END IF
166*
167* Apply second shift
168*
169 v( 1 ) = beta2*( a( 1, 1 )*w( 1 )+a( 1, 2 )*w( 2 ) )-sr2*( b( 1,
170 $ 1 )*w( 1 )+b( 1, 2 )*w( 2 ) )
171 v( 2 ) = beta2*( a( 2, 1 )*w( 1 )+a( 2, 2 )*w( 2 ) )-sr2*( b( 2,
172 $ 1 )*w( 1 )+b( 2, 2 )*w( 2 ) )
173 v( 3 ) = beta2*( a( 3, 1 )*w( 1 )+a( 3, 2 )*w( 2 ) )-sr2*( b( 3,
174 $ 1 )*w( 1 )+b( 3, 2 )*w( 2 ) )
175*
176* Account for imaginary part
177*
178 v( 1 ) = v( 1 )+si*si*b( 1, 1 )/scale1/scale2
179*
180* Check for overflow
181*
182 IF( abs( v( 1 ) ).GT.safmax .OR. abs( v( 2 ) ) .GT. safmax .OR.
183 $ abs( v( 3 ) ).GT.safmax .OR. sisnan( v( 1 ) ) .OR.
184 $ sisnan( v( 2 ) ) .OR. sisnan( v( 3 ) ) ) THEN
185 v( 1 ) = zero
186 v( 2 ) = zero
187 v( 3 ) = zero
188 END IF
189*
190* End of SLAQZ1
191*
192 END SUBROUTINE
subroutine slaqz1(a, lda, b, ldb, sr1, sr2, si, beta1, beta2, v)
SLAQZ1
Definition slaqz1.f:125