1 *> \brief \b DLAED9 used by sstedc. Finds the roots of the secular equation and updates the eigenvectors. Used when the original matrix is dense.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLAED9 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaed9.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaed9.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaed9.f">
21 * SUBROUTINE DLAED9( K, KSTART, KSTOP, N, D, Q, LDQ, RHO, DLAMDA, W,
24 * .. Scalar Arguments ..
25 * INTEGER INFO, K, KSTART, KSTOP, LDQ, LDS, N
26 * DOUBLE PRECISION RHO
28 * .. Array Arguments ..
29 * DOUBLE PRECISION D( * ), DLAMDA( * ), Q( LDQ, * ), S( LDS, * ),
39 *> DLAED9 finds the roots of the secular equation, as defined by the
40 *> values in D, Z, and RHO, between KSTART and KSTOP. It makes the
41 *> appropriate calls to DLAED4 and then stores the new matrix of
42 *> eigenvectors for use in calculating the next level of Z vectors.
51 *> The number of terms in the rational function to be solved by
63 *> The updated eigenvalues Lambda(I), KSTART <= I <= KSTOP
64 *> are to be computed. 1 <= KSTART <= KSTOP <= K.
70 *> The number of rows and columns in the Q matrix.
71 *> N >= K (delation may result in N > K).
76 *> D is DOUBLE PRECISION array, dimension (N)
77 *> D(I) contains the updated eigenvalues
78 *> for KSTART <= I <= KSTOP.
83 *> Q is DOUBLE PRECISION array, dimension (LDQ,N)
89 *> The leading dimension of the array Q. LDQ >= max( 1, N ).
94 *> RHO is DOUBLE PRECISION
95 *> The value of the parameter in the rank one update equation.
101 *> DLAMDA is DOUBLE PRECISION array, dimension (K)
102 *> The first K elements of this array contain the old roots
103 *> of the deflated updating problem. These are the poles
104 *> of the secular equation.
109 *> W is DOUBLE PRECISION array, dimension (K)
110 *> The first K elements of this array contain the components
111 *> of the deflation-adjusted updating vector.
116 *> S is DOUBLE PRECISION array, dimension (LDS, K)
117 *> Will contain the eigenvectors of the repaired matrix which
118 *> will be stored for subsequent Z vector calculation and
119 *> multiplied by the previously accumulated eigenvectors
120 *> to update the system.
126 *> The leading dimension of S. LDS >= max( 1, K ).
132 *> = 0: successful exit.
133 *> < 0: if INFO = -i, the i-th argument had an illegal value.
134 *> > 0: if INFO = 1, an eigenvalue did not converge
140 *> \author Univ. of Tennessee
141 *> \author Univ. of California Berkeley
142 *> \author Univ. of Colorado Denver
145 *> \date September 2012
147 *> \ingroup auxOTHERcomputational
149 *> \par Contributors:
152 *> Jeff Rutter, Computer Science Division, University of California
155 * =====================================================================
156 SUBROUTINE DLAED9( K, KSTART, KSTOP, N, D, Q, LDQ, RHO, DLAMDA, W,
159 * -- LAPACK computational routine (version 3.4.2) --
160 * -- LAPACK is a software package provided by Univ. of Tennessee, --
161 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
164 * .. Scalar Arguments ..
165 INTEGER INFO, K, KSTART, KSTOP, LDQ, LDS, N
168 * .. Array Arguments ..
169 DOUBLE PRECISION D( * ), DLAMDA( * ), Q( LDQ, * ), S( LDS, * ),
173 * =====================================================================
175 * .. Local Scalars ..
177 DOUBLE PRECISION TEMP
179 * .. External Functions ..
180 DOUBLE PRECISION DLAMC3, DNRM2
181 EXTERNAL DLAMC3, DNRM2
183 * .. External Subroutines ..
184 EXTERNAL DCOPY, DLAED4, XERBLA
186 * .. Intrinsic Functions ..
187 INTRINSIC MAX, SIGN, SQRT
189 * .. Executable Statements ..
191 * Test the input parameters.
197 ELSE IF( KSTART.LT.1 .OR. KSTART.GT.MAX( 1, K ) ) THEN
199 ELSE IF( MAX( 1, KSTOP ).LT.KSTART .OR. KSTOP.GT.MAX( 1, K ) )
202 ELSE IF( N.LT.K ) THEN
204 ELSE IF( LDQ.LT.MAX( 1, K ) ) THEN
206 ELSE IF( LDS.LT.MAX( 1, K ) ) THEN
210 CALL XERBLA( 'DLAED9', -INFO )
214 * Quick return if possible
219 * Modify values DLAMDA(i) to make sure all DLAMDA(i)-DLAMDA(j) can
220 * be computed with high relative accuracy (barring over/underflow).
221 * This is a problem on machines without a guard digit in
222 * add/subtract (Cray XMP, Cray YMP, Cray C 90 and Cray 2).
223 * The following code replaces DLAMDA(I) by 2*DLAMDA(I)-DLAMDA(I),
224 * which on any of these machines zeros out the bottommost
225 * bit of DLAMDA(I) if it is 1; this makes the subsequent
226 * subtractions DLAMDA(I)-DLAMDA(J) unproblematic when cancellation
227 * occurs. On binary machines with a guard digit (almost all
228 * machines) it does not change DLAMDA(I) at all. On hexadecimal
229 * and decimal machines with a guard digit, it slightly
230 * changes the bottommost bits of DLAMDA(I). It does not account
231 * for hexadecimal or decimal machines without guard digits
232 * (we know of none). We use a subroutine call to compute
233 * 2*DLAMBDA(I) to prevent optimizing compilers from eliminating
237 DLAMDA( I ) = DLAMC3( DLAMDA( I ), DLAMDA( I ) ) - DLAMDA( I )
240 DO 20 J = KSTART, KSTOP
241 CALL DLAED4( K, J, DLAMDA, W, Q( 1, J ), RHO, D( J ), INFO )
243 * If the zero finder fails, the computation is terminated.
249 IF( K.EQ.1 .OR. K.EQ.2 ) THEN
252 S( J, I ) = Q( J, I )
260 CALL DCOPY( K, W, 1, S, 1 )
262 * Initialize W(I) = Q(I,I)
264 CALL DCOPY( K, Q, LDQ+1, W, 1 )
267 W( I ) = W( I )*( Q( I, J ) / ( DLAMDA( I )-DLAMDA( J ) ) )
270 W( I ) = W( I )*( Q( I, J ) / ( DLAMDA( I )-DLAMDA( J ) ) )
274 W( I ) = SIGN( SQRT( -W( I ) ), S( I, 1 ) )
277 * Compute eigenvectors of the modified rank-1 modification.
281 Q( I, J ) = W( I ) / Q( I, J )
283 TEMP = DNRM2( K, Q( 1, J ), 1 )
285 S( I, J ) = Q( I, J ) / TEMP