LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
slaed9.f
Go to the documentation of this file.
1*> \brief \b SLAED9 used by SSTEDC. Finds the roots of the secular equation and updates the eigenvectors. Used when the original matrix is dense.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SLAED9 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaed9.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaed9.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaed9.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SLAED9( K, KSTART, KSTOP, N, D, Q, LDQ, RHO, DLAMBDA,
20* W, S, LDS, INFO )
21*
22* .. Scalar Arguments ..
23* INTEGER INFO, K, KSTART, KSTOP, LDQ, LDS, N
24* REAL RHO
25* ..
26* .. Array Arguments ..
27* REAL D( * ), DLAMBDA( * ), Q( LDQ, * ), S( LDS, * ),
28* $ W( * )
29* ..
30*
31*
32*> \par Purpose:
33* =============
34*>
35*> \verbatim
36*>
37*> SLAED9 finds the roots of the secular equation, as defined by the
38*> values in D, Z, and RHO, between KSTART and KSTOP. It makes the
39*> appropriate calls to SLAED4 and then stores the new matrix of
40*> eigenvectors for use in calculating the next level of Z vectors.
41*> \endverbatim
42*
43* Arguments:
44* ==========
45*
46*> \param[in] K
47*> \verbatim
48*> K is INTEGER
49*> The number of terms in the rational function to be solved by
50*> SLAED4. K >= 0.
51*> \endverbatim
52*>
53*> \param[in] KSTART
54*> \verbatim
55*> KSTART is INTEGER
56*> \endverbatim
57*>
58*> \param[in] KSTOP
59*> \verbatim
60*> KSTOP is INTEGER
61*> The updated eigenvalues Lambda(I), KSTART <= I <= KSTOP
62*> are to be computed. 1 <= KSTART <= KSTOP <= K.
63*> \endverbatim
64*>
65*> \param[in] N
66*> \verbatim
67*> N is INTEGER
68*> The number of rows and columns in the Q matrix.
69*> N >= K (delation may result in N > K).
70*> \endverbatim
71*>
72*> \param[out] D
73*> \verbatim
74*> D is REAL array, dimension (N)
75*> D(I) contains the updated eigenvalues
76*> for KSTART <= I <= KSTOP.
77*> \endverbatim
78*>
79*> \param[out] Q
80*> \verbatim
81*> Q is REAL array, dimension (LDQ,N)
82*> \endverbatim
83*>
84*> \param[in] LDQ
85*> \verbatim
86*> LDQ is INTEGER
87*> The leading dimension of the array Q. LDQ >= max( 1, N ).
88*> \endverbatim
89*>
90*> \param[in] RHO
91*> \verbatim
92*> RHO is REAL
93*> The value of the parameter in the rank one update equation.
94*> RHO >= 0 required.
95*> \endverbatim
96*>
97*> \param[in] DLAMBDA
98*> \verbatim
99*> DLAMBDA is REAL array, dimension (K)
100*> The first K elements of this array contain the old roots
101*> of the deflated updating problem. These are the poles
102*> of the secular equation.
103*> \endverbatim
104*>
105*> \param[in] W
106*> \verbatim
107*> W is REAL array, dimension (K)
108*> The first K elements of this array contain the components
109*> of the deflation-adjusted updating vector.
110*> \endverbatim
111*>
112*> \param[out] S
113*> \verbatim
114*> S is REAL array, dimension (LDS, K)
115*> Will contain the eigenvectors of the repaired matrix which
116*> will be stored for subsequent Z vector calculation and
117*> multiplied by the previously accumulated eigenvectors
118*> to update the system.
119*> \endverbatim
120*>
121*> \param[in] LDS
122*> \verbatim
123*> LDS is INTEGER
124*> The leading dimension of S. LDS >= max( 1, K ).
125*> \endverbatim
126*>
127*> \param[out] INFO
128*> \verbatim
129*> INFO is INTEGER
130*> = 0: successful exit.
131*> < 0: if INFO = -i, the i-th argument had an illegal value.
132*> > 0: if INFO = 1, an eigenvalue did not converge
133*> \endverbatim
134*
135* Authors:
136* ========
137*
138*> \author Univ. of Tennessee
139*> \author Univ. of California Berkeley
140*> \author Univ. of Colorado Denver
141*> \author NAG Ltd.
142*
143*> \ingroup laed9
144*
145*> \par Contributors:
146* ==================
147*>
148*> Jeff Rutter, Computer Science Division, University of California
149*> at Berkeley, USA
150*
151* =====================================================================
152 SUBROUTINE slaed9( K, KSTART, KSTOP, N, D, Q, LDQ, RHO,
153 $ DLAMBDA,
154 $ W, S, LDS, INFO )
155*
156* -- LAPACK computational routine --
157* -- LAPACK is a software package provided by Univ. of Tennessee, --
158* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159*
160* .. Scalar Arguments ..
161 INTEGER INFO, K, KSTART, KSTOP, LDQ, LDS, N
162 REAL RHO
163* ..
164* .. Array Arguments ..
165 REAL D( * ), DLAMBDA( * ), Q( LDQ, * ), S( LDS, * ),
166 $ W( * )
167* ..
168*
169* =====================================================================
170*
171* .. Local Scalars ..
172 INTEGER I, J
173 REAL TEMP
174* ..
175* .. External Functions ..
176 REAL SNRM2
177 EXTERNAL SNRM2
178* ..
179* .. External Subroutines ..
180 EXTERNAL scopy, slaed4, xerbla
181* ..
182* .. Intrinsic Functions ..
183 INTRINSIC max, sign, sqrt
184* ..
185* .. Executable Statements ..
186*
187* Test the input parameters.
188*
189 info = 0
190*
191 IF( k.LT.0 ) THEN
192 info = -1
193 ELSE IF( kstart.LT.1 .OR. kstart.GT.max( 1, k ) ) THEN
194 info = -2
195 ELSE IF( max( 1, kstop ).LT.kstart .OR. kstop.GT.max( 1, k ) )
196 $ THEN
197 info = -3
198 ELSE IF( n.LT.k ) THEN
199 info = -4
200 ELSE IF( ldq.LT.max( 1, k ) ) THEN
201 info = -7
202 ELSE IF( lds.LT.max( 1, k ) ) THEN
203 info = -12
204 END IF
205 IF( info.NE.0 ) THEN
206 CALL xerbla( 'SLAED9', -info )
207 RETURN
208 END IF
209*
210* Quick return if possible
211*
212 IF( k.EQ.0 )
213 $ RETURN
214*
215 DO 20 j = kstart, kstop
216 CALL slaed4( k, j, dlambda, w, q( 1, j ), rho, d( j ),
217 $ info )
218*
219* If the zero finder fails, the computation is terminated.
220*
221 IF( info.NE.0 )
222 $ GO TO 120
223 20 CONTINUE
224*
225 IF( k.EQ.1 .OR. k.EQ.2 ) THEN
226 DO 40 i = 1, k
227 DO 30 j = 1, k
228 s( j, i ) = q( j, i )
229 30 CONTINUE
230 40 CONTINUE
231 GO TO 120
232 END IF
233*
234* Compute updated W.
235*
236 CALL scopy( k, w, 1, s, 1 )
237*
238* Initialize W(I) = Q(I,I)
239*
240 CALL scopy( k, q, ldq+1, w, 1 )
241 DO 70 j = 1, k
242 DO 50 i = 1, j - 1
243 w( i ) = w( i )*( q( i, j )/( dlambda( i )-dlambda( j ) ) )
244 50 CONTINUE
245 DO 60 i = j + 1, k
246 w( i ) = w( i )*( q( i, j )/( dlambda( i )-dlambda( j ) ) )
247 60 CONTINUE
248 70 CONTINUE
249 DO 80 i = 1, k
250 w( i ) = sign( sqrt( -w( i ) ), s( i, 1 ) )
251 80 CONTINUE
252*
253* Compute eigenvectors of the modified rank-1 modification.
254*
255 DO 110 j = 1, k
256 DO 90 i = 1, k
257 q( i, j ) = w( i ) / q( i, j )
258 90 CONTINUE
259 temp = snrm2( k, q( 1, j ), 1 )
260 DO 100 i = 1, k
261 s( i, j ) = q( i, j ) / temp
262 100 CONTINUE
263 110 CONTINUE
264*
265 120 CONTINUE
266 RETURN
267*
268* End of SLAED9
269*
270 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
Definition scopy.f:82
subroutine slaed4(n, i, d, z, delta, rho, dlam, info)
SLAED4 used by SSTEDC. Finds a single root of the secular equation.
Definition slaed4.f:143
subroutine slaed9(k, kstart, kstop, n, d, q, ldq, rho, dlambda, w, s, lds, info)
SLAED9 used by SSTEDC. Finds the roots of the secular equation and updates the eigenvectors....
Definition slaed9.f:155