--- 
:name: cposvx
:md5sum: 5047940aaa72c0b2ca58d57ec4923985
: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/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- af: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldaf
    - n
- ldaf: 
    :type: integer
    :intent: input
- equed: 
    :type: char
    :intent: input/output
- s: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- b: 
    :type: complex
    :intent: input/output
    :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: workspace
    :dims: 
    - 2*n
- rwork: 
    :type: real
    :intent: workspace
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldx: MAX(1,n)
:fortran_help: "      SUBROUTINE CPOSVX( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, EQUED, S, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  CPOSVX uses the Cholesky factorization A = U**H*U or A = L*L**H to\n\
  *  compute the solution to a complex system of linear equations\n\
  *     A * X = B,\n\
  *  where A is an N-by-N Hermitian positive definite 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 = 'E', real scaling factors are computed to equilibrate\n\
  *     the system:\n\
  *        diag(S) * A * diag(S) * inv(diag(S)) * X = diag(S) * B\n\
  *     Whether or not the system will be equilibrated depends on the\n\
  *     scaling of the matrix A, but if equilibration is used, A is\n\
  *     overwritten by diag(S)*A*diag(S) and B by diag(S)*B.\n\
  *\n\
  *  2. If FACT = 'N' or 'E', the Cholesky decomposition is used to\n\
  *     factor the matrix A (after equilibration if FACT = 'E') as\n\
  *        A = U**H* U,  if UPLO = 'U', or\n\
  *        A = L * L**H,  if UPLO = 'L',\n\
  *     where U is an upper triangular matrix and L is a lower triangular\n\
  *     matrix.\n\
  *\n\
  *  3. 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\
  *  4. The system of equations is solved for X using the factored form\n\
  *     of A.\n\
  *\n\
  *  5. Iterative refinement is applied to improve the computed solution\n\
  *     matrix and calculate error bounds and backward error estimates\n\
  *     for it.\n\
  *\n\
  *  6. If equilibration was used, the matrix X is premultiplied by\n\
  *     diag(S) so that it solves the original system before\n\
  *     equilibration.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  FACT    (input) CHARACTER*1\n\
  *          Specifies whether or not the factored form of the matrix A is\n\
  *          supplied on entry, and if not, whether the matrix A should be\n\
  *          equilibrated before it is factored.\n\
  *          = 'F':  On entry, AF contains the factored form of A.\n\
  *                  If EQUED = 'Y', the matrix A has been equilibrated\n\
  *                  with scaling factors given by S.  A and AF will not\n\
  *                  be modified.\n\
  *          = 'N':  The matrix A will be copied to AF and factored.\n\
  *          = 'E':  The matrix A will be equilibrated if necessary, then\n\
  *                  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/output) COMPLEX array, dimension (LDA,N)\n\
  *          On entry, the Hermitian matrix A, except if FACT = 'F' and\n\
  *          EQUED = 'Y', then A must contain the equilibrated matrix\n\
  *          diag(S)*A*diag(S).  If UPLO = 'U', the leading\n\
  *          N-by-N upper triangular part of A contains the upper\n\
  *          triangular part of the matrix A, and the strictly lower\n\
  *          triangular part of A is not referenced.  If UPLO = 'L', the\n\
  *          leading N-by-N lower triangular part of A contains the lower\n\
  *          triangular part of the matrix A, and the strictly upper\n\
  *          triangular part of A is not referenced.  A is not modified if\n\
  *          FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.\n\
  *\n\
  *          On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by\n\
  *          diag(S)*A*diag(S).\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 triangular factor U or L from the Cholesky\n\
  *          factorization A = U**H*U or A = L*L**H, in the same storage\n\
  *          format as A.  If EQUED .ne. 'N', then AF is the factored form\n\
  *          of the equilibrated matrix diag(S)*A*diag(S).\n\
  *\n\
  *          If FACT = 'N', then AF is an output argument and on exit\n\
  *          returns the triangular factor U or L from the Cholesky\n\
  *          factorization A = U**H*U or A = L*L**H of the original\n\
  *          matrix A.\n\
  *\n\
  *          If FACT = 'E', then AF is an output argument and on exit\n\
  *          returns the triangular factor U or L from the Cholesky\n\
  *          factorization A = U**H*U or A = L*L**H of the equilibrated\n\
  *          matrix A (see the description of A for the form of the\n\
  *          equilibrated matrix).\n\
  *\n\
  *  LDAF    (input) INTEGER\n\
  *          The leading dimension of the array AF.  LDAF >= max(1,N).\n\
  *\n\
  *  EQUED   (input or output) CHARACTER*1\n\
  *          Specifies the form of equilibration that was done.\n\
  *          = 'N':  No equilibration (always true if FACT = 'N').\n\
  *          = 'Y':  Equilibration was done, i.e., A has been replaced by\n\
  *                  diag(S) * A * diag(S).\n\
  *          EQUED is an input argument if FACT = 'F'; otherwise, it is an\n\
  *          output argument.\n\
  *\n\
  *  S       (input or output) REAL array, dimension (N)\n\
  *          The scale factors for A; not accessed if EQUED = 'N'.  S is\n\
  *          an input argument if FACT = 'F'; otherwise, S is an output\n\
  *          argument.  If FACT = 'F' and EQUED = 'Y', each element of S\n\
  *          must be positive.\n\
  *\n\
  *  B       (input/output) COMPLEX array, dimension (LDB,NRHS)\n\
  *          On entry, the N-by-NRHS righthand side matrix B.\n\
  *          On exit, if EQUED = 'N', B is not modified; if EQUED = 'Y',\n\
  *          B is overwritten by diag(S) * 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 to\n\
  *          the original system of equations.  Note that if EQUED = 'Y',\n\
  *          A and B are modified on exit, and the solution to the\n\
  *          equilibrated system is inv(diag(S))*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 after equilibration (if done).  If RCOND is less than the\n\
  *          machine precision (in particular, if RCOND = 0), the matrix\n\
  *          is singular to working precision.  This condition is\n\
  *          indicated by a return code of 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) COMPLEX array, dimension (2*N)\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:  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"
