--- 
:name: csysvx
:md5sum: 77314dc5b8cd439895289aa101e91eb2
:category: :subroutine
:arguments: 
- fact: 
    :type: char
    :intent: input
- uplo: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- nrhs: 
    :type: integer
    :intent: input
- a: 
    :type: complex
    :intent: input
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- af: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldaf
    - n
- ldaf: 
    :type: integer
    :intent: input
- ipiv: 
    :type: integer
    :intent: input/output
    :dims: 
    - n
- b: 
    :type: complex
    :intent: input
    :dims: 
    - ldb
    - nrhs
- ldb: 
    :type: integer
    :intent: input
- x: 
    :type: complex
    :intent: output
    :dims: 
    - ldx
    - nrhs
- ldx: 
    :type: integer
    :intent: input
- rcond: 
    :type: real
    :intent: output
- ferr: 
    :type: real
    :intent: output
    :dims: 
    - nrhs
- berr: 
    :type: real
    :intent: output
    :dims: 
    - nrhs
- work: 
    :type: complex
    :intent: output
    :dims: 
    - MAX(1,lwork)
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: 3*n
- rwork: 
    :type: real
    :intent: workspace
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldx: MAX(1,n)
:fortran_help: "      SUBROUTINE CSYSVX( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, LWORK, RWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  CSYSVX uses the diagonal pivoting factorization to compute the\n\
  *  solution to a complex system of linear equations A * X = B,\n\
  *  where A is an N-by-N symmetric matrix and X and B are N-by-NRHS\n\
  *  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 diagonal pivoting method is used to factor A.\n\
  *     The form of the factorization is\n\
  *        A = U * D * U**T,  if UPLO = 'U', or\n\
  *        A = L * D * L**T,  if UPLO = 'L',\n\
  *     where U (or L) is a product of permutation and unit upper (lower)\n\
  *     triangular matrices, and D is symmetric and block diagonal with\n\
  *     1-by-1 and 2-by-2 diagonal blocks.\n\
  *\n\
  *  2. If some D(i,i)=0, so that D is exactly singular, then the routine\n\
  *     returns with INFO = i. Otherwise, the factored form of A is used\n\
  *     to estimate the condition number of the matrix A.  If the\n\
  *     reciprocal of the condition number is less than machine precision,\n\
  *     INFO = N+1 is returned as a warning, but the routine still goes on\n\
  *     to solve for X and compute error bounds as 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 A has been\n\
  *          supplied on entry.\n\
  *          = 'F':  On entry, AF and IPIV contain the factored form\n\
  *                  of A.  A, AF and IPIV will not be modified.\n\
  *          = 'N':  The matrix A will be copied to AF and factored.\n\
  *\n\
  *  UPLO    (input) CHARACTER*1\n\
  *          = 'U':  Upper triangle of A is stored;\n\
  *          = 'L':  Lower triangle of A is stored.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The number of linear equations, i.e., the order of the\n\
  *          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\
  *  A       (input) COMPLEX array, dimension (LDA,N)\n\
  *          The symmetric matrix A.  If UPLO = 'U', the leading N-by-N\n\
  *          upper triangular part of A contains the upper triangular part\n\
  *          of the matrix A, and the strictly lower triangular part of A\n\
  *          is not referenced.  If UPLO = 'L', the leading N-by-N lower\n\
  *          triangular part of A contains the lower triangular part of\n\
  *          the matrix A, and the strictly upper triangular part of A is\n\
  *          not referenced.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of the array A.  LDA >= max(1,N).\n\
  *\n\
  *  AF      (input or output) COMPLEX array, dimension (LDAF,N)\n\
  *          If FACT = 'F', then AF is an input argument and on entry\n\
  *          contains the block diagonal matrix D and the multipliers used\n\
  *          to obtain the factor U or L from the factorization\n\
  *          A = U*D*U**T or A = L*D*L**T as computed by CSYTRF.\n\
  *\n\
  *          If FACT = 'N', then AF is an output argument and on exit\n\
  *          returns the block diagonal matrix D and the multipliers used\n\
  *          to obtain the factor U or L from the factorization\n\
  *          A = U*D*U**T or A = L*D*L**T.\n\
  *\n\
  *  LDAF    (input) INTEGER\n\
  *          The leading dimension of the array AF.  LDAF >= max(1,N).\n\
  *\n\
  *  IPIV    (input or output) INTEGER array, dimension (N)\n\
  *          If FACT = 'F', then IPIV is an input argument and on entry\n\
  *          contains details of the interchanges and the block structure\n\
  *          of D, as determined by CSYTRF.\n\
  *          If IPIV(k) > 0, then rows and columns k and IPIV(k) were\n\
  *          interchanged and D(k,k) is a 1-by-1 diagonal block.\n\
  *          If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and\n\
  *          columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k)\n\
  *          is a 2-by-2 diagonal block.  If UPLO = 'L' and IPIV(k) =\n\
  *          IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were\n\
  *          interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.\n\
  *\n\
  *          If FACT = 'N', then IPIV is an output argument and on exit\n\
  *          contains details of the interchanges and the block structure\n\
  *          of D, as determined by CSYTRF.\n\
  *\n\
  *  B       (input) COMPLEX 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 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) REAL\n\
  *          The estimate of the reciprocal condition number of the matrix\n\
  *          A.  If RCOND is less than the machine precision (in\n\
  *          particular, if RCOND = 0), the matrix is singular to working\n\
  *          precision.  This condition is indicated by a return code of\n\
  *          INFO > 0.\n\
  *\n\
  *  FERR    (output) REAL array, dimension (NRHS)\n\
  *          The estimated 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).  The estimate is as reliable as\n\
  *          the estimate for RCOND, and is almost always a slight\n\
  *          overestimate of the true error.\n\
  *\n\
  *  BERR    (output) REAL array, dimension (NRHS)\n\
  *          The componentwise relative backward error of each solution\n\
  *          vector X(j) (i.e., the smallest relative change in\n\
  *          any element of A or B that makes X(j) an exact solution).\n\
  *\n\
  *  WORK    (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))\n\
  *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
  *\n\
  *  LWORK   (input) INTEGER\n\
  *          The length of WORK.  LWORK >= max(1,2*N), and for best\n\
  *          performance, when FACT = 'N', LWORK >= max(1,2*N,N*NB), where\n\
  *          NB is the optimal blocksize for CSYTRF.\n\
  *\n\
  *          If LWORK = -1, then a workspace query is assumed; the routine\n\
  *          only calculates the optimal size of the WORK array, returns\n\
  *          this value as the first entry of the WORK array, and no error\n\
  *          message related to LWORK is issued by XERBLA.\n\
  *\n\
  *  RWORK   (workspace) REAL 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:  D(i,i) is exactly zero.  The factorization\n\
  *                       has been completed but the factor D is exactly\n\
  *                       singular, so the solution and error bounds could\n\
  *                       not be computed. RCOND = 0 is returned.\n\
  *                = N+1: D 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"
