1 *> \brief \b SLAED5 used by sstedc. Solves the 2-by-2 secular equation.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLAED5 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaed5.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaed5.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaed5.f">
21 * SUBROUTINE SLAED5( I, D, Z, DELTA, RHO, DLAM )
23 * .. Scalar Arguments ..
27 * .. Array Arguments ..
28 * REAL D( 2 ), DELTA( 2 ), Z( 2 )
37 *> This subroutine computes the I-th eigenvalue of a symmetric rank-one
38 *> modification of a 2-by-2 diagonal matrix
40 *> diag( D ) + RHO * Z * transpose(Z) .
42 *> The diagonal elements in the array D are assumed to satisfy
44 *> D(i) < D(j) for i < j .
46 *> We also assume RHO > 0 and that the Euclidean norm of the vector
56 *> The index of the eigenvalue to be computed. I = 1 or I = 2.
61 *> D is REAL array, dimension (2)
62 *> The original eigenvalues. We assume D(1) < D(2).
67 *> Z is REAL array, dimension (2)
68 *> The components of the updating vector.
73 *> DELTA is REAL array, dimension (2)
74 *> The vector DELTA contains the information necessary
75 *> to construct the eigenvectors.
81 *> The scalar in the symmetric updating formula.
87 *> The computed lambda_I, the I-th updated eigenvalue.
93 *> \author Univ. of Tennessee
94 *> \author Univ. of California Berkeley
95 *> \author Univ. of Colorado Denver
98 *> \date September 2012
100 *> \ingroup auxOTHERcomputational
102 *> \par Contributors:
105 *> Ren-Cang Li, Computer Science Division, University of California
108 * =====================================================================
109 SUBROUTINE SLAED5( I, D, Z, DELTA, RHO, DLAM )
111 * -- LAPACK computational routine (version 3.4.2) --
112 * -- LAPACK is a software package provided by Univ. of Tennessee, --
113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116 * .. Scalar Arguments ..
120 * .. Array Arguments ..
121 REAL D( 2 ), DELTA( 2 ), Z( 2 )
124 * =====================================================================
127 REAL ZERO, ONE, TWO, FOUR
128 PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0, TWO = 2.0E0,
131 * .. Local Scalars ..
132 REAL B, C, DEL, TAU, TEMP, W
134 * .. Intrinsic Functions ..
137 * .. Executable Statements ..
139 DEL = D( 2 ) - D( 1 )
141 W = ONE + TWO*RHO*( Z( 2 )*Z( 2 )-Z( 1 )*Z( 1 ) ) / DEL
143 B = DEL + RHO*( Z( 1 )*Z( 1 )+Z( 2 )*Z( 2 ) )
144 C = RHO*Z( 1 )*Z( 1 )*DEL
148 TAU = TWO*C / ( B+SQRT( ABS( B*B-FOUR*C ) ) )
150 DELTA( 1 ) = -Z( 1 ) / TAU
151 DELTA( 2 ) = Z( 2 ) / ( DEL-TAU )
153 B = -DEL + RHO*( Z( 1 )*Z( 1 )+Z( 2 )*Z( 2 ) )
154 C = RHO*Z( 2 )*Z( 2 )*DEL
156 TAU = -TWO*C / ( B+SQRT( B*B+FOUR*C ) )
158 TAU = ( B-SQRT( B*B+FOUR*C ) ) / TWO
161 DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
162 DELTA( 2 ) = -Z( 2 ) / TAU
164 TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
165 DELTA( 1 ) = DELTA( 1 ) / TEMP
166 DELTA( 2 ) = DELTA( 2 ) / TEMP
171 B = -DEL + RHO*( Z( 1 )*Z( 1 )+Z( 2 )*Z( 2 ) )
172 C = RHO*Z( 2 )*Z( 2 )*DEL
174 TAU = ( B+SQRT( B*B+FOUR*C ) ) / TWO
176 TAU = TWO*C / ( -B+SQRT( B*B+FOUR*C ) )
179 DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
180 DELTA( 2 ) = -Z( 2 ) / TAU
181 TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
182 DELTA( 1 ) = DELTA( 1 ) / TEMP
183 DELTA( 2 ) = DELTA( 2 ) / TEMP