--- 
:name: dstevd
:md5sum: ef38913916fd211c452fc4ca318213ff
:category: :subroutine
:arguments: 
- jobz: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- d: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- e: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n-1
- z: 
    :type: doublereal
    :intent: output
    :dims: 
    - ldz
    - n
- ldz: 
    :type: integer
    :intent: input
- work: 
    :type: doublereal
    :intent: output
    :dims: 
    - MAX(1,lwork)
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: "(lsame_(&jobz,\"N\")||n<=1) ? 1 : (lsame_(&jobz,\"V\")&&n>1) ? 1+4*n+n*n : 0"
- iwork: 
    :type: integer
    :intent: output
    :dims: 
    - MAX(1,liwork)
- liwork: 
    :type: integer
    :intent: input
    :option: true
    :default: "(lsame_(&jobz,\"N\")||n<=1) ? 1 : (lsame_(&jobz,\"V\")&&n>1) ? 3+5*n : 0"
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldz: "lsame_(&jobz,\"V\") ? MAX(1,n) : 1"
:fortran_help: "      SUBROUTINE DSTEVD( JOBZ, N, D, E, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  DSTEVD computes all eigenvalues and, optionally, eigenvectors of a\n\
  *  real symmetric tridiagonal matrix. If eigenvectors are desired, it\n\
  *  uses a divide and conquer algorithm.\n\
  *\n\
  *  The divide and conquer algorithm makes very mild assumptions about\n\
  *  floating point arithmetic. It will work on machines with a guard\n\
  *  digit in add/subtract, or on those binary machines without guard\n\
  *  digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or\n\
  *  Cray-2. It could conceivably fail on hexadecimal or decimal machines\n\
  *  without guard digits, but we know of none.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBZ    (input) CHARACTER*1\n\
  *          = 'N':  Compute eigenvalues only;\n\
  *          = 'V':  Compute eigenvalues and eigenvectors.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrix.  N >= 0.\n\
  *\n\
  *  D       (input/output) DOUBLE PRECISION array, dimension (N)\n\
  *          On entry, the n diagonal elements of the tridiagonal matrix\n\
  *          A.\n\
  *          On exit, if INFO = 0, the eigenvalues in ascending order.\n\
  *\n\
  *  E       (input/output) DOUBLE PRECISION array, dimension (N-1)\n\
  *          On entry, the (n-1) subdiagonal elements of the tridiagonal\n\
  *          matrix A, stored in elements 1 to N-1 of E.\n\
  *          On exit, the contents of E are destroyed.\n\
  *\n\
  *  Z       (output) DOUBLE PRECISION array, dimension (LDZ, N)\n\
  *          If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal\n\
  *          eigenvectors of the matrix A, with the i-th column of Z\n\
  *          holding the eigenvector associated with D(i).\n\
  *          If JOBZ = 'N', then Z is not referenced.\n\
  *\n\
  *  LDZ     (input) INTEGER\n\
  *          The leading dimension of the array Z.  LDZ >= 1, and if\n\
  *          JOBZ = 'V', LDZ >= max(1,N).\n\
  *\n\
  *  WORK    (workspace/output) DOUBLE PRECISION array,\n\
  *                                         dimension (LWORK)\n\
  *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
  *\n\
  *  LWORK   (input) INTEGER\n\
  *          The dimension of the array WORK.\n\
  *          If JOBZ  = 'N' or N <= 1 then LWORK must be at least 1.\n\
  *          If JOBZ  = 'V' and N > 1 then LWORK must be at least\n\
  *                         ( 1 + 4*N + N**2 ).\n\
  *\n\
  *          If LWORK = -1, then a workspace query is assumed; the routine\n\
  *          only calculates the optimal sizes of the WORK and IWORK\n\
  *          arrays, returns these values as the first entries of the WORK\n\
  *          and IWORK arrays, and no error message related to LWORK or\n\
  *          LIWORK is issued by XERBLA.\n\
  *\n\
  *  IWORK   (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))\n\
  *          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.\n\
  *\n\
  *  LIWORK  (input) INTEGER\n\
  *          The dimension of the array IWORK.\n\
  *          If JOBZ  = 'N' or N <= 1 then LIWORK must be at least 1.\n\
  *          If JOBZ  = 'V' and N > 1 then LIWORK must be at least 3+5*N.\n\
  *\n\
  *          If LIWORK = -1, then a workspace query is assumed; the\n\
  *          routine only calculates the optimal sizes of the WORK and\n\
  *          IWORK arrays, returns these values as the first entries of\n\
  *          the WORK and IWORK arrays, and no error message related to\n\
  *          LWORK or LIWORK is issued by XERBLA.\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 = i, the algorithm failed to converge; i\n\
  *                off-diagonal elements of E did not converge to zero.\n\
  *\n\n\
  *  =====================================================================\n\
  *\n"
