LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
slasd5.f
Go to the documentation of this file.
1*> \brief \b SLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SLASD5 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slasd5.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slasd5.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slasd5.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SLASD5( I, D, Z, DELTA, RHO, DSIGMA, WORK )
20*
21* .. Scalar Arguments ..
22* INTEGER I
23* REAL DSIGMA, RHO
24* ..
25* .. Array Arguments ..
26* REAL D( 2 ), DELTA( 2 ), WORK( 2 ), Z( 2 )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> This subroutine computes the square root of the I-th eigenvalue
36*> of a positive symmetric rank-one modification of a 2-by-2 diagonal
37*> matrix
38*>
39*> diag( D ) * diag( D ) + RHO * Z * transpose(Z) .
40*>
41*> The diagonal entries in the array D are assumed to satisfy
42*>
43*> 0 <= D(i) < D(j) for i < j .
44*>
45*> We also assume RHO > 0 and that the Euclidean norm of the vector
46*> Z is one.
47*> \endverbatim
48*
49* Arguments:
50* ==========
51*
52*> \param[in] I
53*> \verbatim
54*> I is INTEGER
55*> The index of the eigenvalue to be computed. I = 1 or I = 2.
56*> \endverbatim
57*>
58*> \param[in] D
59*> \verbatim
60*> D is REAL array, dimension (2)
61*> The original eigenvalues. We assume 0 <= D(1) < D(2).
62*> \endverbatim
63*>
64*> \param[in] Z
65*> \verbatim
66*> Z is REAL array, dimension (2)
67*> The components of the updating vector.
68*> \endverbatim
69*>
70*> \param[out] DELTA
71*> \verbatim
72*> DELTA is REAL array, dimension (2)
73*> Contains (D(j) - sigma_I) in its j-th component.
74*> The vector DELTA contains the information necessary
75*> to construct the eigenvectors.
76*> \endverbatim
77*>
78*> \param[in] RHO
79*> \verbatim
80*> RHO is REAL
81*> The scalar in the symmetric updating formula.
82*> \endverbatim
83*>
84*> \param[out] DSIGMA
85*> \verbatim
86*> DSIGMA is REAL
87*> The computed sigma_I, the I-th updated eigenvalue.
88*> \endverbatim
89*>
90*> \param[out] WORK
91*> \verbatim
92*> WORK is REAL array, dimension (2)
93*> WORK contains (D(j) + sigma_I) in its j-th component.
94*> \endverbatim
95*
96* Authors:
97* ========
98*
99*> \author Univ. of Tennessee
100*> \author Univ. of California Berkeley
101*> \author Univ. of Colorado Denver
102*> \author NAG Ltd.
103*
104*> \ingroup lasd5
105*
106*> \par Contributors:
107* ==================
108*>
109*> Ren-Cang Li, Computer Science Division, University of California
110*> at Berkeley, USA
111*>
112* =====================================================================
113 SUBROUTINE slasd5( I, D, Z, DELTA, RHO, DSIGMA, WORK )
114*
115* -- LAPACK auxiliary routine --
116* -- LAPACK is a software package provided by Univ. of Tennessee, --
117* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
118*
119* .. Scalar Arguments ..
120 INTEGER I
121 REAL DSIGMA, RHO
122* ..
123* .. Array Arguments ..
124 REAL D( 2 ), DELTA( 2 ), WORK( 2 ), Z( 2 )
125* ..
126*
127* =====================================================================
128*
129* .. Parameters ..
130 REAL ZERO, ONE, TWO, THREE, FOUR
131 parameter( zero = 0.0e+0, one = 1.0e+0, two = 2.0e+0,
132 $ three = 3.0e+0, four = 4.0e+0 )
133* ..
134* .. Local Scalars ..
135 REAL B, C, DEL, DELSQ, TAU, W
136* ..
137* .. Intrinsic Functions ..
138 INTRINSIC abs, sqrt
139* ..
140* .. Executable Statements ..
141*
142 del = d( 2 ) - d( 1 )
143 delsq = del*( d( 2 )+d( 1 ) )
144 IF( i.EQ.1 ) THEN
145 w = one + four*rho*( z( 2 )*z( 2 ) / ( d( 1 )+three*d( 2 ) )-
146 $ z( 1 )*z( 1 ) / ( three*d( 1 )+d( 2 ) ) ) / del
147 IF( w.GT.zero ) THEN
148 b = delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
149 c = rho*z( 1 )*z( 1 )*delsq
150*
151* B > ZERO, always
152*
153* The following TAU is DSIGMA * DSIGMA - D( 1 ) * D( 1 )
154*
155 tau = two*c / ( b+sqrt( abs( b*b-four*c ) ) )
156*
157* The following TAU is DSIGMA - D( 1 )
158*
159 tau = tau / ( d( 1 )+sqrt( d( 1 )*d( 1 )+tau ) )
160 dsigma = d( 1 ) + tau
161 delta( 1 ) = -tau
162 delta( 2 ) = del - tau
163 work( 1 ) = two*d( 1 ) + tau
164 work( 2 ) = ( d( 1 )+tau ) + d( 2 )
165* DELTA( 1 ) = -Z( 1 ) / TAU
166* DELTA( 2 ) = Z( 2 ) / ( DEL-TAU )
167 ELSE
168 b = -delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
169 c = rho*z( 2 )*z( 2 )*delsq
170*
171* The following TAU is DSIGMA * DSIGMA - D( 2 ) * D( 2 )
172*
173 IF( b.GT.zero ) THEN
174 tau = -two*c / ( b+sqrt( b*b+four*c ) )
175 ELSE
176 tau = ( b-sqrt( b*b+four*c ) ) / two
177 END IF
178*
179* The following TAU is DSIGMA - D( 2 )
180*
181 tau = tau / ( d( 2 )+sqrt( abs( d( 2 )*d( 2 )+tau ) ) )
182 dsigma = d( 2 ) + tau
183 delta( 1 ) = -( del+tau )
184 delta( 2 ) = -tau
185 work( 1 ) = d( 1 ) + tau + d( 2 )
186 work( 2 ) = two*d( 2 ) + tau
187* DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
188* DELTA( 2 ) = -Z( 2 ) / TAU
189 END IF
190* TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
191* DELTA( 1 ) = DELTA( 1 ) / TEMP
192* DELTA( 2 ) = DELTA( 2 ) / TEMP
193 ELSE
194*
195* Now I=2
196*
197 b = -delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
198 c = rho*z( 2 )*z( 2 )*delsq
199*
200* The following TAU is DSIGMA * DSIGMA - D( 2 ) * D( 2 )
201*
202 IF( b.GT.zero ) THEN
203 tau = ( b+sqrt( b*b+four*c ) ) / two
204 ELSE
205 tau = two*c / ( -b+sqrt( b*b+four*c ) )
206 END IF
207*
208* The following TAU is DSIGMA - D( 2 )
209*
210 tau = tau / ( d( 2 )+sqrt( d( 2 )*d( 2 )+tau ) )
211 dsigma = d( 2 ) + tau
212 delta( 1 ) = -( del+tau )
213 delta( 2 ) = -tau
214 work( 1 ) = d( 1 ) + tau + d( 2 )
215 work( 2 ) = two*d( 2 ) + tau
216* DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
217* DELTA( 2 ) = -Z( 2 ) / TAU
218* TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
219* DELTA( 1 ) = DELTA( 1 ) / TEMP
220* DELTA( 2 ) = DELTA( 2 ) / TEMP
221 END IF
222 RETURN
223*
224* End of SLASD5
225*
226 END
subroutine slasd5(i, d, z, delta, rho, dsigma, work)
SLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification ...
Definition slasd5.f:114