LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dlaed5()

subroutine dlaed5 ( integer  i,
double precision, dimension( 2 )  d,
double precision, dimension( 2 )  z,
double precision, dimension( 2 )  delta,
double precision  rho,
double precision  dlam 
)

DLAED5 used by DSTEDC. Solves the 2-by-2 secular equation.

Download DLAED5 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 This subroutine computes the I-th eigenvalue of a symmetric rank-one
 modification of a 2-by-2 diagonal matrix

            diag( D )  +  RHO * Z * transpose(Z) .

 The diagonal elements in the array D are assumed to satisfy

            D(i) < D(j)  for  i < j .

 We also assume RHO > 0 and that the Euclidean norm of the vector
 Z is one.
Parameters
[in]I
          I is INTEGER
         The index of the eigenvalue to be computed.  I = 1 or I = 2.
[in]D
          D is DOUBLE PRECISION array, dimension (2)
         The original eigenvalues.  We assume D(1) < D(2).
[in]Z
          Z is DOUBLE PRECISION array, dimension (2)
         The components of the updating vector.
[out]DELTA
          DELTA is DOUBLE PRECISION array, dimension (2)
         The vector DELTA contains the information necessary
         to construct the eigenvectors.
[in]RHO
          RHO is DOUBLE PRECISION
         The scalar in the symmetric updating formula.
[out]DLAM
          DLAM is DOUBLE PRECISION
         The computed lambda_I, the I-th updated eigenvalue.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA

Definition at line 107 of file dlaed5.f.

108*
109* -- LAPACK computational routine --
110* -- LAPACK is a software package provided by Univ. of Tennessee, --
111* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
112*
113* .. Scalar Arguments ..
114 INTEGER I
115 DOUBLE PRECISION DLAM, RHO
116* ..
117* .. Array Arguments ..
118 DOUBLE PRECISION D( 2 ), DELTA( 2 ), Z( 2 )
119* ..
120*
121* =====================================================================
122*
123* .. Parameters ..
124 DOUBLE PRECISION ZERO, ONE, TWO, FOUR
125 parameter( zero = 0.0d0, one = 1.0d0, two = 2.0d0,
126 $ four = 4.0d0 )
127* ..
128* .. Local Scalars ..
129 DOUBLE PRECISION B, C, DEL, TAU, TEMP, W
130* ..
131* .. Intrinsic Functions ..
132 INTRINSIC abs, sqrt
133* ..
134* .. Executable Statements ..
135*
136 del = d( 2 ) - d( 1 )
137 IF( i.EQ.1 ) THEN
138 w = one + two*rho*( z( 2 )*z( 2 )-z( 1 )*z( 1 ) ) / del
139 IF( w.GT.zero ) THEN
140 b = del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
141 c = rho*z( 1 )*z( 1 )*del
142*
143* B > ZERO, always
144*
145 tau = two*c / ( b+sqrt( abs( b*b-four*c ) ) )
146 dlam = d( 1 ) + tau
147 delta( 1 ) = -z( 1 ) / tau
148 delta( 2 ) = z( 2 ) / ( del-tau )
149 ELSE
150 b = -del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
151 c = rho*z( 2 )*z( 2 )*del
152 IF( b.GT.zero ) THEN
153 tau = -two*c / ( b+sqrt( b*b+four*c ) )
154 ELSE
155 tau = ( b-sqrt( b*b+four*c ) ) / two
156 END IF
157 dlam = d( 2 ) + tau
158 delta( 1 ) = -z( 1 ) / ( del+tau )
159 delta( 2 ) = -z( 2 ) / tau
160 END IF
161 temp = sqrt( delta( 1 )*delta( 1 )+delta( 2 )*delta( 2 ) )
162 delta( 1 ) = delta( 1 ) / temp
163 delta( 2 ) = delta( 2 ) / temp
164 ELSE
165*
166* Now I=2
167*
168 b = -del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
169 c = rho*z( 2 )*z( 2 )*del
170 IF( b.GT.zero ) THEN
171 tau = ( b+sqrt( b*b+four*c ) ) / two
172 ELSE
173 tau = two*c / ( -b+sqrt( b*b+four*c ) )
174 END IF
175 dlam = d( 2 ) + tau
176 delta( 1 ) = -z( 1 ) / ( del+tau )
177 delta( 2 ) = -z( 2 ) / tau
178 temp = sqrt( delta( 1 )*delta( 1 )+delta( 2 )*delta( 2 ) )
179 delta( 1 ) = delta( 1 ) / temp
180 delta( 2 ) = delta( 2 ) / temp
181 END IF
182 RETURN
183*
184* End of DLAED5
185*
Here is the caller graph for this function: