--- 
:name: slaed2
:md5sum: e070f3045768b0a9fca4dcd7e04b36cc
:category: :subroutine
:arguments: 
- k: 
    :type: integer
    :intent: output
- n: 
    :type: integer
    :intent: input
- n1: 
    :type: integer
    :intent: input
- d: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- q: 
    :type: real
    :intent: input/output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- indxq: 
    :type: integer
    :intent: input/output
    :dims: 
    - n
- rho: 
    :type: real
    :intent: input/output
- z: 
    :type: real
    :intent: input
    :dims: 
    - n
- dlamda: 
    :type: real
    :intent: output
    :dims: 
    - n
- w: 
    :type: real
    :intent: output
    :dims: 
    - n
- q2: 
    :type: real
    :intent: output
    :dims: 
    - pow(n1,2)+pow(n-n1,2)
- indx: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- indxc: 
    :type: integer
    :intent: output
    :dims: 
    - n
- indxp: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- coltyp: 
    :type: integer
    :intent: output
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE SLAED2( K, N, N1, D, Q, LDQ, INDXQ, RHO, Z, DLAMDA, W, Q2, INDX, INDXC, INDXP, COLTYP, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  SLAED2 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 entry 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\
  *  K      (output) INTEGER\n\
  *         The number of non-deflated eigenvalues, and the order of the\n\
  *         related secular equation. 0 <= K <=N.\n\
  *\n\
  *  N      (input) INTEGER\n\
  *         The dimension of the symmetric tridiagonal matrix.  N >= 0.\n\
  *\n\
  *  N1     (input) INTEGER\n\
  *         The location of the last eigenvalue in the leading sub-matrix.\n\
  *         min(1,N) <= N1 <= N/2.\n\
  *\n\
  *  D      (input/output) REAL array, dimension (N)\n\
  *         On entry, D contains the eigenvalues of the two submatrices to\n\
  *         be combined.\n\
  *         On exit, D contains the trailing (N-K) updated eigenvalues\n\
  *         (those which were deflated) sorted into increasing order.\n\
  *\n\
  *  Q      (input/output) REAL array, dimension (LDQ, N)\n\
  *         On entry, Q contains the eigenvectors of two submatrices in\n\
  *         the two square blocks with corners at (1,1), (N1,N1)\n\
  *         and (N1+1, N1+1), (N,N).\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/output) 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 N1 added to their\n\
  *         values. Destroyed on exit.\n\
  *\n\
  *  RHO    (input/output) REAL\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\
  *         SLAED3.\n\
  *\n\
  *  Z      (input) REAL array, dimension (N)\n\
  *         On entry, Z contains the updating vector (the last\n\
  *         row of the first sub-eigenvector matrix and the first row of\n\
  *         the second sub-eigenvector matrix).\n\
  *         On exit, the contents of Z have been destroyed by the updating\n\
  *         process.\n\
  *\n\
  *  DLAMDA (output) REAL array, dimension (N)\n\
  *         A copy of the first K eigenvalues which will be used by\n\
  *         SLAED3 to form the secular equation.\n\
  *\n\
  *  W      (output) REAL array, dimension (N)\n\
  *         The first k values of the final deflation-altered z-vector\n\
  *         which will be passed to SLAED3.\n\
  *\n\
  *  Q2     (output) REAL array, dimension (N1**2+(N-N1)**2)\n\
  *         A copy of the first K eigenvectors which will be used by\n\
  *         SLAED3 in a matrix multiply (SGEMM) to solve for the new\n\
  *         eigenvectors.\n\
  *\n\
  *  INDX   (workspace) INTEGER array, dimension (N)\n\
  *         The permutation used to sort the contents of DLAMDA into\n\
  *         ascending order.\n\
  *\n\
  *  INDXC  (output) INTEGER array, dimension (N)\n\
  *         The permutation used to arrange the columns of the deflated\n\
  *         Q matrix into three groups:  the first group contains non-zero\n\
  *         elements only at and above N1, the second contains\n\
  *         non-zero elements only below N1, and the third is dense.\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\
  *  COLTYP (workspace/output) INTEGER array, dimension (N)\n\
  *         During execution, a label which will indicate which of the\n\
  *         following types a column in the Q2 matrix is:\n\
  *         1 : non-zero in the upper half only;\n\
  *         2 : dense;\n\
  *         3 : non-zero in the lower half only;\n\
  *         4 : deflated.\n\
  *         On exit, COLTYP(i) is the number of columns of type i,\n\
  *         for i=1 to 4 only.\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\
  *  Modified by Francoise Tisseur, University of Tennessee.\n\
  *\n\
  *  =====================================================================\n\
  *\n"
