LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dlaed7 ( integer  ICOMPQ,
integer  N,
integer  QSIZ,
integer  TLVLS,
integer  CURLVL,
integer  CURPBM,
double precision, dimension( * )  D,
double precision, dimension( ldq, * )  Q,
integer  LDQ,
integer, dimension( * )  INDXQ,
double precision  RHO,
integer  CUTPNT,
double precision, dimension( * )  QSTORE,
integer, dimension( * )  QPTR,
integer, dimension( * )  PRMPTR,
integer, dimension( * )  PERM,
integer, dimension( * )  GIVPTR,
integer, dimension( 2, * )  GIVCOL,
double precision, dimension( 2, * )  GIVNUM,
double precision, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

DLAED7 used by sstedc. Computes the updated eigensystem of a diagonal matrix after modification by a rank-one symmetric matrix. Used when the original matrix is dense.

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

Purpose:
 DLAED7 computes the updated eigensystem of a diagonal
 matrix after modification by a rank-one symmetric matrix. This
 routine is used only for the eigenproblem which requires all
 eigenvalues and optionally eigenvectors of a dense symmetric matrix
 that has been reduced to tridiagonal form.  DLAED1 handles
 the case in which all eigenvalues and eigenvectors of a symmetric
 tridiagonal matrix are desired.

   T = Q(in) ( D(in) + RHO * Z*Z**T ) Q**T(in) = Q(out) * D(out) * Q**T(out)

    where Z = Q**Tu, u is a vector of length N with ones in the
    CUTPNT and CUTPNT + 1 th elements and zeros elsewhere.

    The eigenvectors of the original matrix are stored in Q, and the
    eigenvalues are in D.  The algorithm consists of three stages:

       The first stage consists of deflating the size of the problem
       when there are multiple eigenvalues or if there is a zero in
       the Z vector.  For each such occurrence the dimension of the
       secular equation problem is reduced by one.  This stage is
       performed by the routine DLAED8.

       The second stage consists of calculating the updated
       eigenvalues. This is done by finding the roots of the secular
       equation via the routine DLAED4 (as called by DLAED9).
       This routine also calculates the eigenvectors of the current
       problem.

       The final stage consists of computing the updated eigenvectors
       directly using the updated eigenvalues.  The eigenvectors for
       the current problem are multiplied with the eigenvectors from
       the overall problem.
Parameters
[in]ICOMPQ
          ICOMPQ is INTEGER
          = 0:  Compute eigenvalues only.
          = 1:  Compute eigenvectors of original dense symmetric matrix
                also.  On entry, Q contains the orthogonal matrix used
                to reduce the original matrix to tridiagonal form.
[in]N
          N is INTEGER
         The dimension of the symmetric tridiagonal matrix.  N >= 0.
[in]QSIZ
          QSIZ is INTEGER
         The dimension of the orthogonal matrix used to reduce
         the full matrix to tridiagonal form.  QSIZ >= N if ICOMPQ = 1.
[in]TLVLS
          TLVLS is INTEGER
         The total number of merging levels in the overall divide and
         conquer tree.
[in]CURLVL
          CURLVL is INTEGER
         The current level in the overall merge routine,
         0 <= CURLVL <= TLVLS.
[in]CURPBM
          CURPBM is INTEGER
         The current problem in the current level in the overall
         merge routine (counting from upper left to lower right).
[in,out]D
          D is DOUBLE PRECISION array, dimension (N)
         On entry, the eigenvalues of the rank-1-perturbed matrix.
         On exit, the eigenvalues of the repaired matrix.
[in,out]Q
          Q is DOUBLE PRECISION array, dimension (LDQ, N)
         On entry, the eigenvectors of the rank-1-perturbed matrix.
         On exit, the eigenvectors of the repaired tridiagonal matrix.
[in]LDQ
          LDQ is INTEGER
         The leading dimension of the array Q.  LDQ >= max(1,N).
[out]INDXQ
          INDXQ is INTEGER array, dimension (N)
         The permutation which will reintegrate the subproblem just
         solved back into sorted order, i.e., D( INDXQ( I = 1, N ) )
         will be in ascending order.
[in]RHO
          RHO is DOUBLE PRECISION
         The subdiagonal element used to create the rank-1
         modification.
[in]CUTPNT
          CUTPNT is INTEGER
         Contains the location of the last eigenvalue in the leading
         sub-matrix.  min(1,N) <= CUTPNT <= N.
[in,out]QSTORE
          QSTORE is DOUBLE PRECISION array, dimension (N**2+1)
         Stores eigenvectors of submatrices encountered during
         divide and conquer, packed together. QPTR points to
         beginning of the submatrices.
[in,out]QPTR
          QPTR is INTEGER array, dimension (N+2)
         List of indices pointing to beginning of submatrices stored
         in QSTORE. The submatrices are numbered starting at the
         bottom left of the divide and conquer tree, from left to
         right and bottom to top.
[in]PRMPTR
          PRMPTR is INTEGER array, dimension (N lg N)
         Contains a list of pointers which indicate where in PERM a
         level's permutation is stored.  PRMPTR(i+1) - PRMPTR(i)
         indicates the size of the permutation and also the size of
         the full, non-deflated problem.
[in]PERM
          PERM is INTEGER array, dimension (N lg N)
         Contains the permutations (from deflation and sorting) to be
         applied to each eigenblock.
[in]GIVPTR
          GIVPTR is INTEGER array, dimension (N lg N)
         Contains a list of pointers which indicate where in GIVCOL a
         level's Givens rotations are stored.  GIVPTR(i+1) - GIVPTR(i)
         indicates the number of Givens rotations.
[in]GIVCOL
          GIVCOL is INTEGER array, dimension (2, N lg N)
         Each pair of numbers indicates a pair of columns to take place
         in a Givens rotation.
[in]GIVNUM
          GIVNUM is DOUBLE PRECISION array, dimension (2, N lg N)
         Each number indicates the S value to be used in the
         corresponding Givens rotation.
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (3*N+2*QSIZ*N)
[out]IWORK
          IWORK is INTEGER array, dimension (4*N)
[out]INFO
          INFO is INTEGER
          = 0:  successful exit.
          < 0:  if INFO = -i, the i-th argument had an illegal value.
          > 0:  if INFO = 1, an eigenvalue did not converge
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
June 2016
Contributors:
Jeff Rutter, Computer Science Division, University of California at Berkeley, USA

Definition at line 262 of file dlaed7.f.

262 *
263 * -- LAPACK computational routine (version 3.6.1) --
264 * -- LAPACK is a software package provided by Univ. of Tennessee, --
265 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
266 * June 2016
267 *
268 * .. Scalar Arguments ..
269  INTEGER curlvl, curpbm, cutpnt, icompq, info, ldq, n,
270  $ qsiz, tlvls
271  DOUBLE PRECISION rho
272 * ..
273 * .. Array Arguments ..
274  INTEGER givcol( 2, * ), givptr( * ), indxq( * ),
275  $ iwork( * ), perm( * ), prmptr( * ), qptr( * )
276  DOUBLE PRECISION d( * ), givnum( 2, * ), q( ldq, * ),
277  $ qstore( * ), work( * )
278 * ..
279 *
280 * =====================================================================
281 *
282 * .. Parameters ..
283  DOUBLE PRECISION one, zero
284  parameter ( one = 1.0d0, zero = 0.0d0 )
285 * ..
286 * .. Local Scalars ..
287  INTEGER coltyp, curr, i, idlmda, indx, indxc, indxp,
288  $ iq2, is, iw, iz, k, ldq2, n1, n2, ptr
289 * ..
290 * .. External Subroutines ..
291  EXTERNAL dgemm, dlaed8, dlaed9, dlaeda, dlamrg, xerbla
292 * ..
293 * .. Intrinsic Functions ..
294  INTRINSIC max, min
295 * ..
296 * .. Executable Statements ..
297 *
298 * Test the input parameters.
299 *
300  info = 0
301 *
302  IF( icompq.LT.0 .OR. icompq.GT.1 ) THEN
303  info = -1
304  ELSE IF( n.LT.0 ) THEN
305  info = -2
306  ELSE IF( icompq.EQ.1 .AND. qsiz.LT.n ) THEN
307  info = -3
308  ELSE IF( ldq.LT.max( 1, n ) ) THEN
309  info = -9
310  ELSE IF( min( 1, n ).GT.cutpnt .OR. n.LT.cutpnt ) THEN
311  info = -12
312  END IF
313  IF( info.NE.0 ) THEN
314  CALL xerbla( 'DLAED7', -info )
315  RETURN
316  END IF
317 *
318 * Quick return if possible
319 *
320  IF( n.EQ.0 )
321  $ RETURN
322 *
323 * The following values are for bookkeeping purposes only. They are
324 * integer pointers which indicate the portion of the workspace
325 * used by a particular array in DLAED8 and DLAED9.
326 *
327  IF( icompq.EQ.1 ) THEN
328  ldq2 = qsiz
329  ELSE
330  ldq2 = n
331  END IF
332 *
333  iz = 1
334  idlmda = iz + n
335  iw = idlmda + n
336  iq2 = iw + n
337  is = iq2 + n*ldq2
338 *
339  indx = 1
340  indxc = indx + n
341  coltyp = indxc + n
342  indxp = coltyp + n
343 *
344 * Form the z-vector which consists of the last row of Q_1 and the
345 * first row of Q_2.
346 *
347  ptr = 1 + 2**tlvls
348  DO 10 i = 1, curlvl - 1
349  ptr = ptr + 2**( tlvls-i )
350  10 CONTINUE
351  curr = ptr + curpbm
352  CALL dlaeda( n, tlvls, curlvl, curpbm, prmptr, perm, givptr,
353  $ givcol, givnum, qstore, qptr, work( iz ),
354  $ work( iz+n ), info )
355 *
356 * When solving the final problem, we no longer need the stored data,
357 * so we will overwrite the data from this level onto the previously
358 * used storage space.
359 *
360  IF( curlvl.EQ.tlvls ) THEN
361  qptr( curr ) = 1
362  prmptr( curr ) = 1
363  givptr( curr ) = 1
364  END IF
365 *
366 * Sort and Deflate eigenvalues.
367 *
368  CALL dlaed8( icompq, k, n, qsiz, d, q, ldq, indxq, rho, cutpnt,
369  $ work( iz ), work( idlmda ), work( iq2 ), ldq2,
370  $ work( iw ), perm( prmptr( curr ) ), givptr( curr+1 ),
371  $ givcol( 1, givptr( curr ) ),
372  $ givnum( 1, givptr( curr ) ), iwork( indxp ),
373  $ iwork( indx ), info )
374  prmptr( curr+1 ) = prmptr( curr ) + n
375  givptr( curr+1 ) = givptr( curr+1 ) + givptr( curr )
376 *
377 * Solve Secular Equation.
378 *
379  IF( k.NE.0 ) THEN
380  CALL dlaed9( k, 1, k, n, d, work( is ), k, rho, work( idlmda ),
381  $ work( iw ), qstore( qptr( curr ) ), k, info )
382  IF( info.NE.0 )
383  $ GO TO 30
384  IF( icompq.EQ.1 ) THEN
385  CALL dgemm( 'N', 'N', qsiz, k, k, one, work( iq2 ), ldq2,
386  $ qstore( qptr( curr ) ), k, zero, q, ldq )
387  END IF
388  qptr( curr+1 ) = qptr( curr ) + k**2
389 *
390 * Prepare the INDXQ sorting permutation.
391 *
392  n1 = k
393  n2 = n - k
394  CALL dlamrg( n1, n2, d, 1, -1, indxq )
395  ELSE
396  qptr( curr+1 ) = qptr( curr )
397  DO 20 i = 1, n
398  indxq( i ) = i
399  20 CONTINUE
400  END IF
401 *
402  30 CONTINUE
403  RETURN
404 *
405 * End of DLAED7
406 *
subroutine dlaed9(K, KSTART, KSTOP, N, D, Q, LDQ, RHO, DLAMDA, W, S, LDS, INFO)
DLAED9 used by sstedc. Finds the roots of the secular equation and updates the eigenvectors. Used when the original matrix is dense.
Definition: dlaed9.f:158
subroutine dlamrg(N1, N2, A, DTRD1, DTRD2, INDEX)
DLAMRG creates a permutation list to merge the entries of two independently sorted sets into a single...
Definition: dlamrg.f:101
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
Definition: dgemm.f:189
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine dlaed8(ICOMPQ, K, N, QSIZ, D, Q, LDQ, INDXQ, RHO, CUTPNT, Z, DLAMDA, Q2, LDQ2, W, PERM, GIVPTR, GIVCOL, GIVNUM, INDXP, INDX, INFO)
DLAED8 used by sstedc. Merges eigenvalues and deflates secular equation. Used when the original matri...
Definition: dlaed8.f:245
subroutine dlaeda(N, TLVLS, CURLVL, CURPBM, PRMPTR, PERM, GIVPTR, GIVCOL, GIVNUM, Q, QPTR, Z, ZTEMP, INFO)
DLAEDA used by sstedc. Computes the Z vector determining the rank-one modification of the diagonal ma...
Definition: dlaeda.f:168

Here is the call graph for this function:

Here is the caller graph for this function: