--- 
:name: slasd0
:md5sum: ee7a88d8d84c0475b3d0063f24187d61
:category: :subroutine
:arguments: 
- n: 
    :type: integer
    :intent: input
- sqre: 
    :type: integer
    :intent: input
- d: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- e: 
    :type: real
    :intent: input
    :dims: 
    - m-1
- u: 
    :type: real
    :intent: output
    :dims: 
    - ldu
    - n
- ldu: 
    :type: integer
    :intent: input
- vt: 
    :type: real
    :intent: output
    :dims: 
    - ldvt
    - m
- ldvt: 
    :type: integer
    :intent: input
- smlsiz: 
    :type: integer
    :intent: input
- iwork: 
    :type: integer
    :intent: workspace
    :dims: 
    - 8*n
- work: 
    :type: real
    :intent: workspace
    :dims: 
    - 3*pow(m,2)+2*m
- info: 
    :type: integer
    :intent: output
:substitutions: 
  m: "sqre == 0 ? n : sqre == 1 ? n+1 : 0"
  ldvt: m
  ldu: n
:fortran_help: "      SUBROUTINE SLASD0( N, SQRE, D, E, U, LDU, VT, LDVT, SMLSIZ, IWORK, WORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  Using a divide and conquer approach, SLASD0 computes the singular\n\
  *  value decomposition (SVD) of a real upper bidiagonal N-by-M\n\
  *  matrix B with diagonal D and offdiagonal E, where M = N + SQRE.\n\
  *  The algorithm computes orthogonal matrices U and VT such that\n\
  *  B = U * S * VT. The singular values S are overwritten on D.\n\
  *\n\
  *  A related subroutine, SLASDA, computes only the singular values,\n\
  *  and optionally, the singular vectors in compact form.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  N      (input) INTEGER\n\
  *         On entry, the row dimension of the upper bidiagonal matrix.\n\
  *         This is also the dimension of the main diagonal array D.\n\
  *\n\
  *  SQRE   (input) INTEGER\n\
  *         Specifies the column dimension of the bidiagonal matrix.\n\
  *         = 0: The bidiagonal matrix has column dimension M = N;\n\
  *         = 1: The bidiagonal matrix has column dimension M = N+1;\n\
  *\n\
  *  D      (input/output) REAL array, dimension (N)\n\
  *         On entry D contains the main diagonal of the bidiagonal\n\
  *         matrix.\n\
  *         On exit D, if INFO = 0, contains its singular values.\n\
  *\n\
  *  E      (input) REAL array, dimension (M-1)\n\
  *         Contains the subdiagonal entries of the bidiagonal matrix.\n\
  *         On exit, E has been destroyed.\n\
  *\n\
  *  U      (output) REAL array, dimension at least (LDQ, N)\n\
  *         On exit, U contains the left singular vectors.\n\
  *\n\
  *  LDU    (input) INTEGER\n\
  *         On entry, leading dimension of U.\n\
  *\n\
  *  VT     (output) REAL array, dimension at least (LDVT, M)\n\
  *         On exit, VT' contains the right singular vectors.\n\
  *\n\
  *  LDVT   (input) INTEGER\n\
  *         On entry, leading dimension of VT.\n\
  *\n\
  *  SMLSIZ (input) INTEGER\n\
  *         On entry, maximum size of the subproblems at the\n\
  *         bottom of the computation tree.\n\
  *\n\
  *  IWORK  (workspace) INTEGER array, dimension (8*N)\n\
  *\n\
  *  WORK   (workspace) REAL array, dimension (3*M**2+2*M)\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, a singular value did not converge\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  Based on contributions by\n\
  *     Ming Gu and Huan Ren, Computer Science Division, University of\n\
  *     California at Berkeley, USA\n\
  *\n\
  *  =====================================================================\n\
  *\n\
  *     .. Local Scalars ..\n      INTEGER            I, I1, IC, IDXQ, IDXQC, IM1, INODE, ITEMP, IWK,\n     $                   J, LF, LL, LVL, M, NCC, ND, NDB1, NDIML, NDIMR,\n     $                   NL, NLF, NLP1, NLVL, NR, NRF, NRP1, SQREI\n      REAL               ALPHA, BETA\n\
  *     ..\n\
  *     .. External Subroutines ..\n      EXTERNAL           SLASD1, SLASDQ, SLASDT, XERBLA\n\
  *     ..\n"
