--- 
:name: cbdsqr
:md5sum: 2ab59917ff5e0610f9099f32c4b9bca8
:category: :subroutine
:arguments: 
- uplo: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- ncvt: 
    :type: integer
    :intent: input
- nru: 
    :type: integer
    :intent: input
- ncc: 
    :type: integer
    :intent: input
- d: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- e: 
    :type: real
    :intent: input/output
    :dims: 
    - n-1
- vt: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldvt
    - ncvt
- ldvt: 
    :type: integer
    :intent: input
- u: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldu
    - n
- ldu: 
    :type: integer
    :intent: input
- c: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldc
    - ncc
- ldc: 
    :type: integer
    :intent: input
- rwork: 
    :type: real
    :intent: workspace
    :dims: 
    - "(ncvt==nru)&&(nru==ncc)&&(ncc==0) ? 2*n : MAX(1, 4*n-4)"
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE CBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, LDU, C, LDC, RWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  CBDSQR computes the singular values and, optionally, the right and/or\n\
  *  left singular vectors from the singular value decomposition (SVD) of\n\
  *  a real N-by-N (upper or lower) bidiagonal matrix B using the implicit\n\
  *  zero-shift QR algorithm.  The SVD of B has the form\n\
  *  \n\
  *     B = Q * S * P**H\n\
  *  \n\
  *  where S is the diagonal matrix of singular values, Q is an orthogonal\n\
  *  matrix of left singular vectors, and P is an orthogonal matrix of\n\
  *  right singular vectors.  If left singular vectors are requested, this\n\
  *  subroutine actually returns U*Q instead of Q, and, if right singular\n\
  *  vectors are requested, this subroutine returns P**H*VT instead of\n\
  *  P**H, for given complex input matrices U and VT.  When U and VT are\n\
  *  the unitary matrices that reduce a general matrix A to bidiagonal\n\
  *  form: A = U*B*VT, as computed by CGEBRD, then\n\
  *  \n\
  *     A = (U*Q) * S * (P**H*VT)\n\
  *  \n\
  *  is the SVD of A.  Optionally, the subroutine may also compute Q**H*C\n\
  *  for a given complex input matrix C.\n\
  *\n\
  *  See \"Computing  Small Singular Values of Bidiagonal Matrices With\n\
  *  Guaranteed High Relative Accuracy,\" by J. Demmel and W. Kahan,\n\
  *  LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11,\n\
  *  no. 5, pp. 873-912, Sept 1990) and\n\
  *  \"Accurate singular values and differential qd algorithms,\" by\n\
  *  B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics\n\
  *  Department, University of California at Berkeley, July 1992\n\
  *  for a detailed description of the algorithm.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  UPLO    (input) CHARACTER*1\n\
  *          = 'U':  B is upper bidiagonal;\n\
  *          = 'L':  B is lower bidiagonal.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrix B.  N >= 0.\n\
  *\n\
  *  NCVT    (input) INTEGER\n\
  *          The number of columns of the matrix VT. NCVT >= 0.\n\
  *\n\
  *  NRU     (input) INTEGER\n\
  *          The number of rows of the matrix U. NRU >= 0.\n\
  *\n\
  *  NCC     (input) INTEGER\n\
  *          The number of columns of the matrix C. NCC >= 0.\n\
  *\n\
  *  D       (input/output) REAL array, dimension (N)\n\
  *          On entry, the n diagonal elements of the bidiagonal matrix B.\n\
  *          On exit, if INFO=0, the singular values of B in decreasing\n\
  *          order.\n\
  *\n\
  *  E       (input/output) REAL array, dimension (N-1)\n\
  *          On entry, the N-1 offdiagonal elements of the bidiagonal\n\
  *          matrix B.\n\
  *          On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E\n\
  *          will contain the diagonal and superdiagonal elements of a\n\
  *          bidiagonal matrix orthogonally equivalent to the one given\n\
  *          as input.\n\
  *\n\
  *  VT      (input/output) COMPLEX array, dimension (LDVT, NCVT)\n\
  *          On entry, an N-by-NCVT matrix VT.\n\
  *          On exit, VT is overwritten by P**H * VT.\n\
  *          Not referenced if NCVT = 0.\n\
  *\n\
  *  LDVT    (input) INTEGER\n\
  *          The leading dimension of the array VT.\n\
  *          LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0.\n\
  *\n\
  *  U       (input/output) COMPLEX array, dimension (LDU, N)\n\
  *          On entry, an NRU-by-N matrix U.\n\
  *          On exit, U is overwritten by U * Q.\n\
  *          Not referenced if NRU = 0.\n\
  *\n\
  *  LDU     (input) INTEGER\n\
  *          The leading dimension of the array U.  LDU >= max(1,NRU).\n\
  *\n\
  *  C       (input/output) COMPLEX array, dimension (LDC, NCC)\n\
  *          On entry, an N-by-NCC matrix C.\n\
  *          On exit, C is overwritten by Q**H * C.\n\
  *          Not referenced if NCC = 0.\n\
  *\n\
  *  LDC     (input) INTEGER\n\
  *          The leading dimension of the array C.\n\
  *          LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0.\n\
  *\n\
  *  RWORK   (workspace) REAL array, dimension (2*N) \n\
  *          if NCVT = NRU = NCC = 0, (max(1, 4*N-4)) otherwise\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit\n\
  *          < 0:  If INFO = -i, the i-th argument had an illegal value\n\
  *          > 0:  the algorithm did not converge; D and E contain the\n\
  *                elements of a bidiagonal matrix which is orthogonally\n\
  *                similar to the input matrix B;  if INFO = i, i\n\
  *                elements of E have not converged to zero.\n\
  *\n\
  *  Internal Parameters\n\
  *  ===================\n\
  *\n\
  *  TOLMUL  REAL, default = max(10,min(100,EPS**(-1/8)))\n\
  *          TOLMUL controls the convergence criterion of the QR loop.\n\
  *          If it is positive, TOLMUL*EPS is the desired relative\n\
  *             precision in the computed singular values.\n\
  *          If it is negative, abs(TOLMUL*EPS*sigma_max) is the\n\
  *             desired absolute accuracy in the computed singular\n\
  *             values (corresponds to relative accuracy\n\
  *             abs(TOLMUL*EPS) in the largest singular value.\n\
  *          abs(TOLMUL) should be between 1 and 1/EPS, and preferably\n\
  *             between 10 (for fast convergence) and .1/EPS\n\
  *             (for there to be some accuracy in the results).\n\
  *          Default is to lose at either one eighth or 2 of the\n\
  *             available decimal digits in each computed singular value\n\
  *             (whichever is smaller).\n\
  *\n\
  *  MAXITR  INTEGER, default = 6\n\
  *          MAXITR controls the maximum number of passes of the\n\
  *          algorithm through its inner loop. The algorithms stops\n\
  *          (and so fails to converge) if the number of passes\n\
  *          through the inner loop exceeds MAXITR*N**2.\n\
  *\n\n\
  *  =====================================================================\n\
  *\n"
