LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ slaed5()

subroutine slaed5 ( integer  I,
real, dimension( 2 )  D,
real, dimension( 2 )  Z,
real, dimension( 2 )  DELTA,
real  RHO,
real  DLAM 
)

SLAED5 used by sstedc. Solves the 2-by-2 secular equation.

Download SLAED5 + 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 REAL array, dimension (2)
         The original eigenvalues.  We assume D(1) < D(2).
[in]Z
          Z is REAL array, dimension (2)
         The components of the updating vector.
[out]DELTA
          DELTA is REAL array, dimension (2)
         The vector DELTA contains the information necessary
         to construct the eigenvectors.
[in]RHO
          RHO is REAL
         The scalar in the symmetric updating formula.
[out]DLAM
          DLAM is REAL
         The computed lambda_I, the I-th updated eigenvalue.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016
Contributors:
Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA

Definition at line 110 of file slaed5.f.

110 *
111 * -- LAPACK computational routine (version 3.7.0) --
112 * -- LAPACK is a software package provided by Univ. of Tennessee, --
113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
114 * December 2016
115 *
116 * .. Scalar Arguments ..
117  INTEGER i
118  REAL dlam, rho
119 * ..
120 * .. Array Arguments ..
121  REAL d( 2 ), delta( 2 ), z( 2 )
122 * ..
123 *
124 * =====================================================================
125 *
126 * .. Parameters ..
127  REAL zero, one, two, four
128  parameter( zero = 0.0e0, one = 1.0e0, two = 2.0e0,
129  $ four = 4.0e0 )
130 * ..
131 * .. Local Scalars ..
132  REAL b, c, del, tau, temp, w
133 * ..
134 * .. Intrinsic Functions ..
135  INTRINSIC abs, sqrt
136 * ..
137 * .. Executable Statements ..
138 *
139  del = d( 2 ) - d( 1 )
140  IF( i.EQ.1 ) THEN
141  w = one + two*rho*( z( 2 )*z( 2 )-z( 1 )*z( 1 ) ) / del
142  IF( w.GT.zero ) THEN
143  b = del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
144  c = rho*z( 1 )*z( 1 )*del
145 *
146 * B > ZERO, always
147 *
148  tau = two*c / ( b+sqrt( abs( b*b-four*c ) ) )
149  dlam = d( 1 ) + tau
150  delta( 1 ) = -z( 1 ) / tau
151  delta( 2 ) = z( 2 ) / ( del-tau )
152  ELSE
153  b = -del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
154  c = rho*z( 2 )*z( 2 )*del
155  IF( b.GT.zero ) THEN
156  tau = -two*c / ( b+sqrt( b*b+four*c ) )
157  ELSE
158  tau = ( b-sqrt( b*b+four*c ) ) / two
159  END IF
160  dlam = d( 2 ) + tau
161  delta( 1 ) = -z( 1 ) / ( del+tau )
162  delta( 2 ) = -z( 2 ) / tau
163  END IF
164  temp = sqrt( delta( 1 )*delta( 1 )+delta( 2 )*delta( 2 ) )
165  delta( 1 ) = delta( 1 ) / temp
166  delta( 2 ) = delta( 2 ) / temp
167  ELSE
168 *
169 * Now I=2
170 *
171  b = -del + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
172  c = rho*z( 2 )*z( 2 )*del
173  IF( b.GT.zero ) THEN
174  tau = ( b+sqrt( b*b+four*c ) ) / two
175  ELSE
176  tau = two*c / ( -b+sqrt( b*b+four*c ) )
177  END IF
178  dlam = d( 2 ) + tau
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
184  END IF
185  RETURN
186 *
187 * End OF SLAED5
188 *
Here is the caller graph for this function: