--- 
:name: dlaed8
:md5sum: d8ce12a706721da54812694fab3a1bbe
:category: :subroutine
:arguments: 
- icompq: 
    :type: integer
    :intent: input
- k: 
    :type: integer
    :intent: output
- n: 
    :type: integer
    :intent: input
- qsiz: 
    :type: integer
    :intent: input
- d: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- q: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - "icompq==0 ? 0 : ldq"
    - "icompq==0 ? 0 : n"
- ldq: 
    :type: integer
    :intent: input
- indxq: 
    :type: integer
    :intent: input
    :dims: 
    - n
- rho: 
    :type: doublereal
    :intent: input/output
- cutpnt: 
    :type: integer
    :intent: input
- z: 
    :type: doublereal
    :intent: input
    :dims: 
    - n
- dlamda: 
    :type: doublereal
    :intent: output
    :dims: 
    - n
- q2: 
    :type: doublereal
    :intent: output
    :dims: 
    - "icompq==0 ? 0 : ldq2"
    - "icompq==0 ? 0 : n"
- ldq2: 
    :type: integer
    :intent: input
- w: 
    :type: doublereal
    :intent: output
    :dims: 
    - n
- perm: 
    :type: integer
    :intent: output
    :dims: 
    - n
- givptr: 
    :type: integer
    :intent: output
- givcol: 
    :type: integer
    :intent: output
    :dims: 
    - "2"
    - n
- givnum: 
    :type: doublereal
    :intent: output
    :dims: 
    - "2"
    - n
- indxp: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- indx: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldq2: MAX(1,n)
:fortran_help: "      SUBROUTINE DLAED8( ICOMPQ, K, N, QSIZ, D, Q, LDQ, INDXQ, RHO, CUTPNT, Z, DLAMDA, Q2, LDQ2, W, PERM, GIVPTR, GIVCOL, GIVNUM, INDXP, INDX, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  DLAED8 merges the two sets of eigenvalues together into a single\n\
  *  sorted set.  Then it tries to deflate the size of the problem.\n\
  *  There are two ways in which deflation can occur:  when two or more\n\
  *  eigenvalues are close together or if there is a tiny element in the\n\
  *  Z vector.  For each such occurrence the order of the related secular\n\
  *  equation problem is reduced by one.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  ICOMPQ  (input) INTEGER\n\
  *          = 0:  Compute eigenvalues only.\n\
  *          = 1:  Compute eigenvectors of original dense symmetric matrix\n\
  *                also.  On entry, Q contains the orthogonal matrix used\n\
  *                to reduce the original matrix to tridiagonal form.\n\
  *\n\
  *  K      (output) INTEGER\n\
  *         The number of non-deflated eigenvalues, and the order of the\n\
  *         related secular equation.\n\
  *\n\
  *  N      (input) INTEGER\n\
  *         The dimension of the symmetric tridiagonal matrix.  N >= 0.\n\
  *\n\
  *  QSIZ   (input) INTEGER\n\
  *         The dimension of the orthogonal matrix used to reduce\n\
  *         the full matrix to tridiagonal form.  QSIZ >= N if ICOMPQ = 1.\n\
  *\n\
  *  D      (input/output) DOUBLE PRECISION array, dimension (N)\n\
  *         On entry, the eigenvalues of the two submatrices to be\n\
  *         combined.  On exit, the trailing (N-K) updated eigenvalues\n\
  *         (those which were deflated) sorted into increasing order.\n\
  *\n\
  *  Q      (input/output) DOUBLE PRECISION array, dimension (LDQ,N)\n\
  *         If ICOMPQ = 0, Q is not referenced.  Otherwise,\n\
  *         on entry, Q contains the eigenvectors of the partially solved\n\
  *         system which has been previously updated in matrix\n\
  *         multiplies with other partially solved eigensystems.\n\
  *         On exit, Q contains the trailing (N-K) updated eigenvectors\n\
  *         (those which were deflated) in its last N-K columns.\n\
  *\n\
  *  LDQ    (input) INTEGER\n\
  *         The leading dimension of the array Q.  LDQ >= max(1,N).\n\
  *\n\
  *  INDXQ  (input) INTEGER array, dimension (N)\n\
  *         The permutation which separately sorts the two sub-problems\n\
  *         in D into ascending order.  Note that elements in the second\n\
  *         half of this permutation must first have CUTPNT added to\n\
  *         their values in order to be accurate.\n\
  *\n\
  *  RHO    (input/output) DOUBLE PRECISION\n\
  *         On entry, the off-diagonal element associated with the rank-1\n\
  *         cut which originally split the two submatrices which are now\n\
  *         being recombined.\n\
  *         On exit, RHO has been modified to the value required by\n\
  *         DLAED3.\n\
  *\n\
  *  CUTPNT (input) INTEGER\n\
  *         The location of the last eigenvalue in the leading\n\
  *         sub-matrix.  min(1,N) <= CUTPNT <= N.\n\
  *\n\
  *  Z      (input) DOUBLE PRECISION array, dimension (N)\n\
  *         On entry, Z contains the updating vector (the last row of\n\
  *         the first sub-eigenvector matrix and the first row of the\n\
  *         second sub-eigenvector matrix).\n\
  *         On exit, the contents of Z are destroyed by the updating\n\
  *         process.\n\
  *\n\
  *  DLAMDA (output) DOUBLE PRECISION array, dimension (N)\n\
  *         A copy of the first K eigenvalues which will be used by\n\
  *         DLAED3 to form the secular equation.\n\
  *\n\
  *  Q2     (output) DOUBLE PRECISION array, dimension (LDQ2,N)\n\
  *         If ICOMPQ = 0, Q2 is not referenced.  Otherwise,\n\
  *         a copy of the first K eigenvectors which will be used by\n\
  *         DLAED7 in a matrix multiply (DGEMM) to update the new\n\
  *         eigenvectors.\n\
  *\n\
  *  LDQ2   (input) INTEGER\n\
  *         The leading dimension of the array Q2.  LDQ2 >= max(1,N).\n\
  *\n\
  *  W      (output) DOUBLE PRECISION array, dimension (N)\n\
  *         The first k values of the final deflation-altered z-vector and\n\
  *         will be passed to DLAED3.\n\
  *\n\
  *  PERM   (output) INTEGER array, dimension (N)\n\
  *         The permutations (from deflation and sorting) to be applied\n\
  *         to each eigenblock.\n\
  *\n\
  *  GIVPTR (output) INTEGER\n\
  *         The number of Givens rotations which took place in this\n\
  *         subproblem.\n\
  *\n\
  *  GIVCOL (output) INTEGER array, dimension (2, N)\n\
  *         Each pair of numbers indicates a pair of columns to take place\n\
  *         in a Givens rotation.\n\
  *\n\
  *  GIVNUM (output) DOUBLE PRECISION array, dimension (2, N)\n\
  *         Each number indicates the S value to be used in the\n\
  *         corresponding Givens rotation.\n\
  *\n\
  *  INDXP  (workspace) INTEGER array, dimension (N)\n\
  *         The permutation used to place deflated values of D at the end\n\
  *         of the array.  INDXP(1:K) points to the nondeflated D-values\n\
  *         and INDXP(K+1:N) points to the deflated eigenvalues.\n\
  *\n\
  *  INDX   (workspace) INTEGER array, dimension (N)\n\
  *         The permutation used to sort the contents of D into ascending\n\
  *         order.\n\
  *\n\
  *  INFO   (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  Based on contributions by\n\
  *     Jeff Rutter, Computer Science Division, University of California\n\
  *     at Berkeley, USA\n\
  *\n\
  *  =====================================================================\n\
  *\n"
