--- 
:name: zptsvx
:md5sum: f74ed0acaf4ad8aafce833be62fc059b
:category: :subroutine
:arguments: 
- fact: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- nrhs: 
    :type: integer
    :intent: input
- d: 
    :type: doublereal
    :intent: input
    :dims: 
    - n
- e: 
    :type: doublecomplex
    :intent: input
    :dims: 
    - n-1
- df: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- ef: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - n-1
- b: 
    :type: doublecomplex
    :intent: input
    :dims: 
    - ldb
    - nrhs
- ldb: 
    :type: integer
    :intent: input
- x: 
    :type: doublecomplex
    :intent: output
    :dims: 
    - ldx
    - nrhs
- ldx: 
    :type: integer
    :intent: input
- rcond: 
    :type: doublereal
    :intent: output
- ferr: 
    :type: doublereal
    :intent: output
    :dims: 
    - nrhs
- berr: 
    :type: doublereal
    :intent: output
    :dims: 
    - nrhs
- work: 
    :type: doublecomplex
    :intent: workspace
    :dims: 
    - n
- rwork: 
    :type: doublereal
    :intent: workspace
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldx: MAX(1,n)
:fortran_help: "      SUBROUTINE ZPTSVX( FACT, N, NRHS, D, E, DF, EF, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  ZPTSVX uses the factorization A = L*D*L**H to compute the solution\n\
  *  to a complex system of linear equations A*X = B, where A is an\n\
  *  N-by-N Hermitian positive definite tridiagonal matrix and X and B\n\
  *  are N-by-NRHS matrices.\n\
  *\n\
  *  Error bounds on the solution and a condition estimate are also\n\
  *  provided.\n\
  *\n\
  *  Description\n\
  *  ===========\n\
  *\n\
  *  The following steps are performed:\n\
  *\n\
  *  1. If FACT = 'N', the matrix A is factored as A = L*D*L**H, where L\n\
  *     is a unit lower bidiagonal matrix and D is diagonal.  The\n\
  *     factorization can also be regarded as having the form\n\
  *     A = U**H*D*U.\n\
  *\n\
  *  2. If the leading i-by-i principal minor is not positive definite,\n\
  *     then the routine returns with INFO = i. Otherwise, the factored\n\
  *     form of A is used to estimate the condition number of the matrix\n\
  *     A.  If the reciprocal of the condition number is less than machine\n\
  *     precision, INFO = N+1 is returned as a warning, but the routine\n\
  *     still goes on to solve for X and compute error bounds as\n\
  *     described below.\n\
  *\n\
  *  3. The system of equations is solved for X using the factored form\n\
  *     of A.\n\
  *\n\
  *  4. Iterative refinement is applied to improve the computed solution\n\
  *     matrix and calculate error bounds and backward error estimates\n\
  *     for it.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  FACT    (input) CHARACTER*1\n\
  *          Specifies whether or not the factored form of the matrix\n\
  *          A is supplied on entry.\n\
  *          = 'F':  On entry, DF and EF contain the factored form of A.\n\
  *                  D, E, DF, and EF will not be modified.\n\
  *          = 'N':  The matrix A will be copied to DF and EF and\n\
  *                  factored.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrix A.  N >= 0.\n\
  *\n\
  *  NRHS    (input) INTEGER\n\
  *          The number of right hand sides, i.e., the number of columns\n\
  *          of the matrices B and X.  NRHS >= 0.\n\
  *\n\
  *  D       (input) DOUBLE PRECISION array, dimension (N)\n\
  *          The n diagonal elements of the tridiagonal matrix A.\n\
  *\n\
  *  E       (input) COMPLEX*16 array, dimension (N-1)\n\
  *          The (n-1) subdiagonal elements of the tridiagonal matrix A.\n\
  *\n\
  *  DF      (input or output) DOUBLE PRECISION array, dimension (N)\n\
  *          If FACT = 'F', then DF is an input argument and on entry\n\
  *          contains the n diagonal elements of the diagonal matrix D\n\
  *          from the L*D*L**H factorization of A.\n\
  *          If FACT = 'N', then DF is an output argument and on exit\n\
  *          contains the n diagonal elements of the diagonal matrix D\n\
  *          from the L*D*L**H factorization of A.\n\
  *\n\
  *  EF      (input or output) COMPLEX*16 array, dimension (N-1)\n\
  *          If FACT = 'F', then EF is an input argument and on entry\n\
  *          contains the (n-1) subdiagonal elements of the unit\n\
  *          bidiagonal factor L from the L*D*L**H factorization of A.\n\
  *          If FACT = 'N', then EF is an output argument and on exit\n\
  *          contains the (n-1) subdiagonal elements of the unit\n\
  *          bidiagonal factor L from the L*D*L**H factorization of A.\n\
  *\n\
  *  B       (input) COMPLEX*16 array, dimension (LDB,NRHS)\n\
  *          The N-by-NRHS right hand side matrix B.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of the array B.  LDB >= max(1,N).\n\
  *\n\
  *  X       (output) COMPLEX*16 array, dimension (LDX,NRHS)\n\
  *          If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X.\n\
  *\n\
  *  LDX     (input) INTEGER\n\
  *          The leading dimension of the array X.  LDX >= max(1,N).\n\
  *\n\
  *  RCOND   (output) DOUBLE PRECISION\n\
  *          The reciprocal condition number of the matrix A.  If RCOND\n\
  *          is less than the machine precision (in particular, if\n\
  *          RCOND = 0), the matrix is singular to working precision.\n\
  *          This condition is indicated by a return code of INFO > 0.\n\
  *\n\
  *  FERR    (output) DOUBLE PRECISION array, dimension (NRHS)\n\
  *          The forward error bound for each solution vector\n\
  *          X(j) (the j-th column of the solution matrix X).\n\
  *          If XTRUE is the true solution corresponding to X(j), FERR(j)\n\
  *          is an estimated upper bound for the magnitude of the largest\n\
  *          element in (X(j) - XTRUE) divided by the magnitude of the\n\
  *          largest element in X(j).\n\
  *\n\
  *  BERR    (output) DOUBLE PRECISION array, dimension (NRHS)\n\
  *          The componentwise relative backward error of each solution\n\
  *          vector X(j) (i.e., the smallest relative change in any\n\
  *          element of A or B that makes X(j) an exact solution).\n\
  *\n\
  *  WORK    (workspace) COMPLEX*16 array, dimension (N)\n\
  *\n\
  *  RWORK   (workspace) DOUBLE PRECISION array, dimension (N)\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, and i is\n\
  *                <= N:  the leading minor of order i of A is\n\
  *                       not positive definite, so the factorization\n\
  *                       could not be completed, and the solution has not\n\
  *                       been computed. RCOND = 0 is returned.\n\
  *                = N+1: U is nonsingular, but RCOND is less than machine\n\
  *                       precision, meaning that the matrix is singular\n\
  *                       to working precision.  Nevertheless, the\n\
  *                       solution and error bounds are computed because\n\
  *                       there are a number of situations where the\n\
  *                       computed solution can be more accurate than the\n\
  *                       value of RCOND would suggest.\n\
  *\n\n\
  *  =====================================================================\n\
  *\n"
