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

◆ dlasd5()

subroutine dlasd5 ( integer i,
double precision, dimension( 2 ) d,
double precision, dimension( 2 ) z,
double precision, dimension( 2 ) delta,
double precision rho,
double precision dsigma,
double precision, dimension( 2 ) work )

DLASD5 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.

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

Purpose:
!>
!> This subroutine computes the square root of the I-th eigenvalue
!> of a positive symmetric rank-one modification of a 2-by-2 diagonal
!> matrix
!>
!>            diag( D ) * diag( D ) +  RHO * Z * transpose(Z) .
!>
!> The diagonal entries in the array D are assumed to satisfy
!>
!>            0 <= 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 0 <= 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 )
!>         Contains (D(j) - sigma_I) in its  j-th component.
!>         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]DSIGMA
!>          DSIGMA is DOUBLE PRECISION
!>         The computed sigma_I, the I-th updated eigenvalue.
!> 
[out]WORK
!>          WORK is DOUBLE PRECISION array, dimension ( 2 )
!>         WORK contains (D(j) + sigma_I) in its  j-th component.
!> 
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 113 of file dlasd5.f.

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 DOUBLE PRECISION DSIGMA, RHO
122* ..
123* .. Array Arguments ..
124 DOUBLE PRECISION D( 2 ), DELTA( 2 ), WORK( 2 ), Z( 2 )
125* ..
126*
127* =====================================================================
128*
129* .. Parameters ..
130 DOUBLE PRECISION ZERO, ONE, TWO, THREE, FOUR
131 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0,
132 $ three = 3.0d+0, four = 4.0d+0 )
133* ..
134* .. Local Scalars ..
135 DOUBLE PRECISION 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 DLASD5
225*
Here is the caller graph for this function: