--- 
:name: zlaed7
:md5sum: d4f753104c3d1ea76346b6c9c300455a
:category: :subroutine
:arguments: 
- n: 
    :type: integer
    :intent: input
- cutpnt: 
    :type: integer
    :intent: input
- qsiz: 
    :type: integer
    :intent: input
- tlvls: 
    :type: integer
    :intent: input
- curlvl: 
    :type: integer
    :intent: input
- curpbm: 
    :type: integer
    :intent: input
- d: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- q: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- rho: 
    :type: doublereal
    :intent: input
- indxq: 
    :type: integer
    :intent: output
    :dims: 
    - n
- qstore: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - pow(n,2)+1
- qptr: 
    :type: integer
    :intent: input/output
    :dims: 
    - n+2
- prmptr: 
    :type: integer
    :intent: input
    :dims: 
    - n*LG(n)
- perm: 
    :type: integer
    :intent: input
    :dims: 
    - n*LG(n)
- givptr: 
    :type: integer
    :intent: input
    :dims: 
    - n*LG(n)
- givcol: 
    :type: integer
    :intent: input
    :dims: 
    - "2"
    - n*LG(n)
- givnum: 
    :type: doublereal
    :intent: input
    :dims: 
    - "2"
    - n*LG(n)
- work: 
    :type: doublecomplex
    :intent: workspace
    :dims: 
    - qsiz*n
- rwork: 
    :type: doublereal
    :intent: workspace
    :dims: 
    - 3*n+2*qsiz*n
- iwork: 
    :type: integer
    :intent: workspace
    :dims: 
    - 4*n
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE ZLAED7( N, CUTPNT, QSIZ, TLVLS, CURLVL, CURPBM, D, Q, LDQ, RHO, INDXQ, QSTORE, QPTR, PRMPTR, PERM, GIVPTR, GIVCOL, GIVNUM, WORK, RWORK, IWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  ZLAED7 computes the updated eigensystem of a diagonal\n\
  *  matrix after modification by a rank-one symmetric matrix. This\n\
  *  routine is used only for the eigenproblem which requires all\n\
  *  eigenvalues and optionally eigenvectors of a dense or banded\n\
  *  Hermitian matrix that has been reduced to tridiagonal form.\n\
  *\n\
  *    T = Q(in) ( D(in) + RHO * Z*Z' ) Q'(in) = Q(out) * D(out) * Q'(out)\n\
  *\n\
  *    where Z = Q'u, u is a vector of length N with ones in the\n\
  *    CUTPNT and CUTPNT + 1 th elements and zeros elsewhere.\n\
  *\n\
  *     The eigenvectors of the original matrix are stored in Q, and the\n\
  *     eigenvalues are in D.  The algorithm consists of three stages:\n\
  *\n\
  *        The first stage consists of deflating the size of the problem\n\
  *        when there are multiple eigenvalues or if there is a zero in\n\
  *        the Z vector.  For each such occurence the dimension of the\n\
  *        secular equation problem is reduced by one.  This stage is\n\
  *        performed by the routine DLAED2.\n\
  *\n\
  *        The second stage consists of calculating the updated\n\
  *        eigenvalues. This is done by finding the roots of the secular\n\
  *        equation via the routine DLAED4 (as called by SLAED3).\n\
  *        This routine also calculates the eigenvectors of the current\n\
  *        problem.\n\
  *\n\
  *        The final stage consists of computing the updated eigenvectors\n\
  *        directly using the updated eigenvalues.  The eigenvectors for\n\
  *        the current problem are multiplied with the eigenvectors from\n\
  *        the overall problem.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  N      (input) INTEGER\n\
  *         The dimension of the symmetric tridiagonal matrix.  N >= 0.\n\
  *\n\
  *  CUTPNT (input) INTEGER\n\
  *         Contains the location of the last eigenvalue in the leading\n\
  *         sub-matrix.  min(1,N) <= CUTPNT <= N.\n\
  *\n\
  *  QSIZ   (input) INTEGER\n\
  *         The dimension of the unitary matrix used to reduce\n\
  *         the full matrix to tridiagonal form.  QSIZ >= N.\n\
  *\n\
  *  TLVLS  (input) INTEGER\n\
  *         The total number of merging levels in the overall divide and\n\
  *         conquer tree.\n\
  *\n\
  *  CURLVL (input) INTEGER\n\
  *         The current level in the overall merge routine,\n\
  *         0 <= curlvl <= tlvls.\n\
  *\n\
  *  CURPBM (input) INTEGER\n\
  *         The current problem in the current level in the overall\n\
  *         merge routine (counting from upper left to lower right).\n\
  *\n\
  *  D      (input/output) DOUBLE PRECISION array, dimension (N)\n\
  *         On entry, the eigenvalues of the rank-1-perturbed matrix.\n\
  *         On exit, the eigenvalues of the repaired matrix.\n\
  *\n\
  *  Q      (input/output) COMPLEX*16 array, dimension (LDQ,N)\n\
  *         On entry, the eigenvectors of the rank-1-perturbed matrix.\n\
  *         On exit, the eigenvectors of the repaired tridiagonal matrix.\n\
  *\n\
  *  LDQ    (input) INTEGER\n\
  *         The leading dimension of the array Q.  LDQ >= max(1,N).\n\
  *\n\
  *  RHO    (input) DOUBLE PRECISION\n\
  *         Contains the subdiagonal element used to create the rank-1\n\
  *         modification.\n\
  *\n\
  *  INDXQ  (output) INTEGER array, dimension (N)\n\
  *         This contains the permutation which will reintegrate the\n\
  *         subproblem just solved back into sorted order,\n\
  *         ie. D( INDXQ( I = 1, N ) ) will be in ascending order.\n\
  *\n\
  *  IWORK  (workspace) INTEGER array, dimension (4*N)\n\
  *\n\
  *  RWORK  (workspace) DOUBLE PRECISION array,\n\
  *                                 dimension (3*N+2*QSIZ*N)\n\
  *\n\
  *  WORK   (workspace) COMPLEX*16 array, dimension (QSIZ*N)\n\
  *\n\
  *  QSTORE (input/output) DOUBLE PRECISION array, dimension (N**2+1)\n\
  *         Stores eigenvectors of submatrices encountered during\n\
  *         divide and conquer, packed together. QPTR points to\n\
  *         beginning of the submatrices.\n\
  *\n\
  *  QPTR   (input/output) INTEGER array, dimension (N+2)\n\
  *         List of indices pointing to beginning of submatrices stored\n\
  *         in QSTORE. The submatrices are numbered starting at the\n\
  *         bottom left of the divide and conquer tree, from left to\n\
  *         right and bottom to top.\n\
  *\n\
  *  PRMPTR (input) INTEGER array, dimension (N lg N)\n\
  *         Contains a list of pointers which indicate where in PERM a\n\
  *         level's permutation is stored.  PRMPTR(i+1) - PRMPTR(i)\n\
  *         indicates the size of the permutation and also the size of\n\
  *         the full, non-deflated problem.\n\
  *\n\
  *  PERM   (input) INTEGER array, dimension (N lg N)\n\
  *         Contains the permutations (from deflation and sorting) to be\n\
  *         applied to each eigenblock.\n\
  *\n\
  *  GIVPTR (input) INTEGER array, dimension (N lg N)\n\
  *         Contains a list of pointers which indicate where in GIVCOL a\n\
  *         level's Givens rotations are stored.  GIVPTR(i+1) - GIVPTR(i)\n\
  *         indicates the number of Givens rotations.\n\
  *\n\
  *  GIVCOL (input) INTEGER array, dimension (2, N lg N)\n\
  *         Each pair of numbers indicates a pair of columns to take place\n\
  *         in a Givens rotation.\n\
  *\n\
  *  GIVNUM (input) DOUBLE PRECISION array, dimension (2, N lg N)\n\
  *         Each number indicates the S value to be used in the\n\
  *         corresponding Givens rotation.\n\
  *\n\
  *  INFO   (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *          > 0:  if INFO = 1, an eigenvalue did not converge\n\
  *\n\n\
  *  =====================================================================\n\
  *\n\
  *     .. Local Scalars ..\n      INTEGER            COLTYP, CURR, I, IDLMDA, INDX,\n     $                   INDXC, INDXP, IQ, IW, IZ, K, N1, N2, PTR\n\
  *     ..\n\
  *     .. External Subroutines ..\n      EXTERNAL           DLAED9, DLAEDA, DLAMRG, XERBLA, ZLACRM, ZLAED8\n\
  *     ..\n\
  *     .. Intrinsic Functions ..\n      INTRINSIC          MAX, MIN\n\
  *     ..\n"
