gerfsx(3)

πŸŽ€ NAME πŸŽ€

gerfsx β€” gerfsx: iterative refinement, expert

okay so first things first bestie: this whole page lives in the Library Functions Manual (yes, section 3, the "my code compiles and now I have questions" shelf πŸ’…), and the main character of the entire page is literally named gerfsx, which the page spells out as gerfsx: iterative refinement, expert. Say it five times fast. You can't. Nobody can. 🫢


✨ SYNOPSIS ✨

Functions

Four subroutines, one for each flavor of your matrix, because LAPACK is nothing if not thorough 🌈. Here they are, exactly as written, no edits, no cap:

subroutine cgerfsx (trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c,
    b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
    err_bnds_comp, nparams, params, work, rwork, info)
    CGERFSX
subroutine dgerfsx (trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c,
    b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
    err_bnds_comp, nparams, params, work, iwork, info)
    DGERFSX
subroutine sgerfsx (trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c,
    b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
    err_bnds_comp, nparams, params, work, iwork, info)
    SGERFSX
subroutine zgerfsx (trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c,
    b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
    err_bnds_comp, nparams, params, work, rwork, info)
    ZGERFSX

spot the pattern πŸ‘€ β€” c and z roll with rwork, d and s roll with iwork. that's it, that's the whole difference, slay.


πŸ¦‹ DETAILED DESCRIPTION πŸ¦‹

this is where the actual tea lives 🍡 β€” the deep dive, the Detailed Description, followed immediately by the Function Documentation. keep scrolling bestie, we're going in.


πŸ‘‘ FUNCTION DOCUMENTATION πŸ‘‘

subroutine cgerfsx

subroutine cgerfsx (character trans, character equed, integer n, integer
    nrhs, complex, dimension( lda, * ) a, integer lda, complex, dimension(
    ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv, real,
    dimension( * ) r, real, dimension( * ) c, complex, dimension( ldb, * )
    b, integer ldb, complex, dimension( ldx , * ) x, integer ldx, real
    rcond, real, dimension( * ) berr, integer n_err_bnds, real, dimension(
    nrhs, * ) err_bnds_norm, real, dimension( nrhs, * ) err_bnds_comp,
    integer nparams, real, dimension( * ) params, complex, dimension( * )
    work, real, dimension( * ) rwork, integer info)

🌸 Purpose 🌸

okay so what does this thing actually do? CGERFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. that's the whole vibe. πŸ’–

and it's not just normwise, bestie β€” in addition to the normwise error bound, the code provides a maximum componentwise error bound if possible. see the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds (they're further down, we'll get there 🫢).

the original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. in that case, the solution and error bounds returned are for the original unequilibrated system β€” yes, it un-does the glow-up for you, iconic.

some optional parameters are bundled in the PARAMS array. these settings determine how refinement is performed, but often the defaults are acceptable. and if the defaults are acceptable, users can pass NPARAMS = 0, which prevents the source code from accessing the PARAMS argument. respect the lazy option πŸ™ˆ.

🧚 Parameters 🧚

TRANS β€” CHARACTER*1, specifies the form of the system of equations:

  • = 'N': A * X = B (No transpose)
  • = 'T': A**T * X = B (Transpose)
  • = 'C': A**H * X = B (Conjugate transpose)

EQUED β€” CHARACTER*1, specifies the form of equilibration that was done to A before calling this routine. this is needed to compute the solution and error bounds correctly β€” skip it and your answers are giving nonsense 😭:

  • = 'N': No equilibration
  • = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
  • = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
  • = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.

N β€” INTEGER. The order of the matrix A. N >= 0.

NRHS β€” INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

A β€” COMPLEX array, dimension (LDA,N). The original N-by-N matrix A.

LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).

AF β€” COMPLEX array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by CGETRF.

LDAF β€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).

IPIV β€” INTEGER array, dimension (N). The pivot indices from CGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

R β€” REAL array, dimension (N). The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed.

⚠️ if R is accessed, each element of R should be a power of the radix to ensure a reliable solution and error estimates. scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. so like… don't do that πŸ’€

C β€” REAL array, dimension (N). The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed.

⚠️ same energy as R, so listen up: if C is accessed, each element of C should be a power of the radix to ensure a reliable solution and error estimates. scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. lowkey the exact same warning, highkey important πŸ”₯

B β€” COMPLEX array, dimension (LDB,NRHS). The right hand side matrix B.

LDB β€” INTEGER. The leading dimension of the array B. LDB >= max(1,N).

X β€” COMPLEX array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by CGETRS. On exit, the improved solution matrix X. glow-up complete ✨

LDX β€” INTEGER. The leading dimension of the array X. LDX >= max(1,N).

RCOND β€” REAL. Reciprocal scaled condition number. this is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). if this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. note that the error may still be small even if this number is very small and the matrix appears ill-conditioned β€” so don't panic immediately, bestie 🫢

BERR β€” REAL array, dimension (NRHS). Componentwise relative backward error. this is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

N_ERR_BNDS β€” INTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below. πŸ‘€

ERR_BNDS_NORM β€” REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

     Normwise relative error in the ith solution vector:
             max_j (abs(XTRUE(j,i) - X(j,i)))
            ------------------------------
                  max_j abs(X(j,i))

the array is indexed by the type of error information as described below. there currently are up to three pieces of information returned.

the first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.

the second index in ERR_BNDS_NORM(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 β€” error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is ␣ (the sentence literally just… stops there in the source, the word got ate πŸ’€ i'm not inventing one, that's the whole sentence as written). These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

see Lapack Working Note 165 for further details and extra cautions. πŸ“š

ERR_BNDS_COMP


…and that's exactly where part 1 runs out of page 🫢 β€” ERR_BNDS_COMP is literally sitting there mid-thought, no description, nothing, just vibes. hold that thought, the next part picks it right back up πŸ’…

  • ERR_BNDS_COMP β€” a REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains info about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:

Componentwise relative error in the ith solution vector:

                    abs(XTRUE(j,i) - X(j,i))
             max_j ----------------------
                         abs(X(j,i))

The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.

The second index in ERR_BNDS_COMP(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

See Lapack Working Note 165 for further details and extra cautions.

  • NPARAMS β€” INTEGER. Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used.
  • PARAMS β€” REAL array, dimension NPARAMS. Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
    • PARAMS(LA_LINRX_ITREF_I = 1) β€” whether to perform iterative refinement or not.
      • Default: 1.0
      • = 0.0: No refinement is performed, and no error bounds are computed.
      • = 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION.
      • (other values are reserved for future use)
    • PARAMS(LA_LINRX_ITHRESH_I = 2) β€” maximum number of residual computations allowed for refinement.
      • Default: 10
      • Aggressive: set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in err_bnds_norm and err_bnds_comp may no longer be trustworthy.
    • PARAMS(LA_LINRX_CWISE_I = 3) β€” flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false.
      • Default: 1.0 (attempt componentwise convergence)
  • WORK β€” COMPLEX array, dimension (2*N).
  • RWORK β€” REAL array, dimension (2*N).
  • INFO β€” INTEGER. Here’s the status tea:
    • = 0: Successful exit. The solution to every right-hand side is guaranteed.
    • < 0: If INFO = -i, the i-th argument had an illegal value.
    • > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned.
    • = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.

🌟 Author 🌟

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

🧾 Definition 🧾

Definition at line 410 of file cgerfsx.f.


subroutine dgerfsx (character trans, character equed, integer n, integer
    nrhs, double precision, dimension( lda, * ) a, integer lda, double
    precision, dimension( ldaf, * ) af, integer ldaf, integer, dimension( *
    ) ipiv, double precision, dimension( * ) r, double precision, dimension(
    * ) c, double precision, dimension( ldb, * ) b, integer ldb, double
    precision, dimension( ldx , * ) x, integer ldx, double precision rcond,
    double precision, dimension( * ) berr, integer n_err_bnds, double
    precision, dimension( nrhs, * ) err_bnds_norm, double precision,
    dimension( nrhs, * ) err_bnds_comp, integer nparams, double precision,
    dimension( * ) params, double precision, dimension( * ) work, integer,
    dimension( * ) iwork, integer info)

πŸ’… DGERFSX πŸ’…

✨ Purpose ✨

Okay so DGERFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds.

The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system.

Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument.

πŸ’… Parameters πŸ’…

  • TRANS β€” CHARACTER*1. Specifies the form of the system of equations:
    • = 'N': A * X = B (No transpose)
    • = 'T': A**T * X = B (Transpose)
    • = 'C': A**H * X = B (Conjugate transpose = Transpose)
  • EQUED β€” CHARACTER*1. Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.
    • = 'N': No equilibration
    • = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
    • = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
    • = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.
  • N β€” INTEGER. The order of the matrix A. N >= 0.
  • NRHS β€” INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • A β€” DOUBLE PRECISION array, dimension (LDA,N). The original N-by-N matrix A.
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF β€” DOUBLE PRECISION array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by DGETRF.
  • LDAF β€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). The pivot indices from DGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
  • R β€”

okay so continuing the arg tour, we're still in the GERFSX parameter list β€” buckle up, bestie, there's a lot of array bookkeeping and honestly it's lowkey iconic how precise this all is πŸŽ€


R

So R is a DOUBLE PRECISION array, dimension (N) β€” it's the row scale factors for A ✨

  • If EQUED = 'R' or EQUED = 'B', then A gets multiplied on the left by diag(R) πŸ’…
  • If EQUED = 'N' or EQUED = 'C', then R is literally not accessed at all, like it's not even invited to the function call πŸ™ˆ

And here's the important part, so pay attention: if R is accessed, every element of R should be a power of the radix, because that's what makes the solution and error estimates reliable. Scaling by powers of the radix doesn't cause rounding errors β€” unless the result underflows or overflows, which, yeah 😭

Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, and that produces error estimates that may not be reliable. So, like, respect the radix.

C

C is also a DOUBLE PRECISION array, dimension (N) β€” the column scale factors for A 🌸

  • If EQUED = 'C' or EQUED = 'B', A gets multiplied on the right by diag(C) πŸ’–
  • If EQUED = 'N' or EQUED = 'R', then C is not accessed, periodt πŸ’€

Same rule as R, and the way I need you to remember this: if C is accessed, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows ✨

And fr fr, rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix β€” producing error estimates that may not be reliable. Same warning, different letter, she's consistent πŸ‘‘

B

B is a DOUBLE PRECISION array, dimension (LDB,NRHS). It's just the right hand side matrix B. That's it. That's the whole vibe. 🫢


LDB

LDB is INTEGER. It's the leading dimension of the array B, and it must satisfy:

LDB >= max(1,N)

no notes, she's just built like that πŸ’…


X

X is a DOUBLE PRECISION array, dimension (LDX,NRHS) β€” and she's got a glow-up arc ✨

  • On entry: the solution matrix X, as computed by DGETRS
  • On exit: the improved solution matrix X πŸ‘‘

literally came in mid, leaves improved. main character energy.


LDX

LDX is INTEGER β€” the leading dimension of the array X, and:

LDX >= max(1,N)

same rules as her sibling LDB, no cap 🧚


RCOND

RCOND is DOUBLE PRECISION β€” the reciprocal scaled condition number 🌈

It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if equilibration was done, anyway).

Here's the tea: if this is less than the machine precision β€” and in particular if it's zero β€” then the matrix is singular to working precision πŸ’€

But wait, plot twist: the error may still be small even if this number is very, very small and the matrix appears ill-conditioned. So don't just panic at a tiny RCOND, bestie, read the whole picture 😌


BERR

BERR is a DOUBLE PRECISION array, dimension (NRHS) β€” the componentwise relative backward error πŸŽ€

More specifically: it's the componentwise relative backward error of each solution vector X(j) β€” i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution. That's the definition and I need you to hold it gently 🫢


N_ERR_BNDS

N_ERR_BNDS is INTEGER β€” the number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below πŸ‘‡βœ¨


ERR_BNDS_NORM

ERR_BNDS_NORM is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) 🌸

For each right-hand side, this array contains info about various error bounds and condition numbers corresponding to the normwise relative error, defined like this:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information, as described below. There currently are up to three pieces of information returned πŸ’…

The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.

The second index in ERR_BNDS_NORM(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * dlamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true πŸ‘€
  • err = 3 β€” reciprocal condition number: estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
See Lapack Working Note 165 for further details and extra cautions πŸ“š

ERR_BNDS_COMP

ERR_BNDS_COMP is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) πŸ¦‹

For each right-hand side, this array contains info about various error bounds and condition numbers corresponding to the componentwise relative error, defined as:

               abs(XTRUE(j,i) - X(j,i))
        max_j ----------------------
                    abs(X(j,i))

The array is indexed by the right-hand side i (the componentwise relative error depends on it) and the type of error information described below. There currently are up to three pieces of information returned for each right-hand side.

Heads up: if componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed πŸ™ˆ And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.

The second index in ERR_BNDS_COMP(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * dlamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.
See Lapack Working Note 165 for further details and extra cautions πŸ“š (yes, again β€” she means it)

NPARAMS

NPARAMS is INTEGER β€” it specifies the number of parameters set in PARAMS πŸ’œ

And if NPARAMS <= 0, then the PARAMS array is never referenced and default values are used. No reads, no drama, defaults only πŸŽ€


PARAMS

PARAMS is a DOUBLE PRECISION array, dimension (NPARAMS) β€” the algorithm parameters themselves ✨

If an entry is < 0.0, then that entry gets filled with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. Easy 🫢

PARAMS(LA_LINRX_ITREF_I = 1) β€” whether to perform iterative refinement or not.

  • Default: 1.0D+0
  • = 0.0: no refinement is performed, and no error bounds are computed
  • = 1.0: use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION
  • (other values are reserved for future use) πŸ‘€

PARAMS(LA_LINRX_ITHRESH_I = 2) β€” maximum number of residual computations allowed for refinement.

  • Default: 10
  • Aggressive: set to 100 to permit convergence using approximate factorizations or factorizations other than LU πŸ’€
  • ⚠️ But listen: if the factorization uses a technique other than Gaussian elimination, the guarantees in err_bnds_norm and err_bnds_comp may no longer be trustworthy. So aggressive mode is giving "I know what I'm doing" energy β€” make sure you actually do 😭

PARAMS(LA_LINRX_CWISE_I = 3) β€” flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false.

  • Default: 1.0 (attempt componentwise convergence) 🌈

WORK

WORK is a DOUBLE PRECISION array, dimension (4*N) πŸ“ that's the whole mood.


IWORK

IWORK is INTEGER array, dimension (N) ⭐ also just vibing.


INFO

  • INFO β€” INTEGER. The exit-status tea β˜•. Here's the vibe check on every possible value:
    • = 0: Successful exit, bestie! The solution to every right-hand side is guaranteed. We ate. πŸ’…
    • < 0: If INFO = -i, the i-th argument had an illegal value. Wrong input, straight to jail. πŸ™ˆ
    • > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed β€” RCOND = 0 is returned. It's giving "we tried and the matrix said no" πŸ’€
    • = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides, check ERR_BNDS_NORM or ERR_BNDS_COMP. iykyk 🫢

πŸ‘‘ Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Definition at line 410 of file dgerfsx.f. ✨


πŸŒ€ sgerfsx β€” the single-precision twin has entered the chat

subroutine sgerfsx (character trans, character equed, integer n, integer
    nrhs, real, dimension( lda, * ) a, integer lda, real, dimension( ldaf, *
    ) af, integer ldaf, integer, dimension( * ) ipiv, real, dimension( * )
    r, real, dimension( * ) c, real, dimension( ldb, * ) b, integer ldb,
    real, dimension( ldx , * ) x, integer ldx, real rcond, real, dimension(
    * ) berr, integer n_err_bnds, real, dimension( nrhs, * ) err_bnds_norm,
    real, dimension( nrhs, * ) err_bnds_comp, integer nparams, real,
    dimension( * ) params, real, dimension( * ) work, integer, dimension( *
    ) iwork, integer info)

SGERFSX

🎯 Purpose

Okay so real talk β€” SGERFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on the error bounds. πŸ“βœ¨

The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In that case, the solution and error bounds returned are for the original unequilibrated system β€” like, we un-do the glow-up so you get the real thing back. πŸ¦‹

Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. Lazy girl math: NPARAMS = 0 and you never have to think about it again. πŸ’…

🧾 Parameters

  • TRANS β€” CHARACTER*1. Specifies the form of the system of equations:
    • = 'N': A * X = B (No transpose)
    • = 'T': A**T * X = B (Transpose)
    • = 'C': A**H * X = B (Conjugate transpose = Transpose)
  • EQUED β€” CHARACTER*1. Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly β€” get it wrong and the numbers are lying to you, no cap. 🫣
    • = 'N': No equilibration
    • = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
    • = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
    • = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.
  • N β€” INTEGER. The order of the matrix A. N >= 0.
  • NRHS β€” INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • A β€” REAL array, dimension (LDA,N). The original N-by-N matrix A. The main character before anything happened to it. πŸ‘‘
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF β€” REAL array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by SGETRF.
  • LDAF β€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). The pivot indices from SGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i). πŸ”€
  • R β€” REAL array, dimension (N). The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed. If R is accessed, each element of R should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. ⚠️ (So like, powers of the radix only. It's a rule, not a suggestion.)
  • C β€” REAL array, dimension (N). The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. If C is accessed, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. Same energy as R, column edition. 🌸
  • B β€” REAL array, dimension (LDB,NRHS). The right hand side matrix B.
  • LDB β€” INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • X β€” REAL array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by SGETRS. On exit, the improved solution matrix X. Glow-up delivered. ✨
  • LDX β€” INTEGER. The leading dimension of the array X. LDX >= max(1,N).
  • RCOND β€” REAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. Like, don't panic immediately. 😌
  • BERR β€” REAL array, dimension (NRHS). Componentwise relative backward error. This is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution). 🎯
  • N_ERR_BNDS β€” INTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below.
  • ERR_BNDS_NORM β€” REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

Normwise relative error in the *i*th solution vector:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.

The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side.

The second index in ERR_BNDS_NORM(:,err) contains the following three fields:

  • err = 1: boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2: error bound β€” the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. 🫑
  • err = 3: Reciprocal condition number β€” estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is. (yeah the original sentence just ends there, no cap β€” nothing after "is".) These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

See Lapack Working Note 165 for further details and extra cautions. πŸ“š

  • ERR_BNDS_COMP
  • ERR_BNDS_COMP β€” okay bestie, this one is a REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, it’s holding info about various error bounds and condition numbers that go with the componentwise relative error, which is defined like this:
         abs(XTRUE(j,i) - X(j,i))
  max_j ----------------------
               abs(X(j,i))

literally the componentwise relative error in the ith solution vector, no cap.

The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.

The second index in ERR_BNDS_COMP(:,err) contains the following three fields:

  • err = 1 boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

See Lapack Working Note 165 for further details and extra cautions. iykyk πŸ’…

  • NPARAMS β€” NPARAMS is INTEGER. Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. so chill β€” you can just skip it if defaults are your vibe ✨
  • PARAMS β€” PARAMS is REAL array, dimension NPARAMS. Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
    • PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative refinement or not. Default: 1.0
      • = 0.0: No refinement is performed, and no error bounds are computed.
      • = 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION.
      • (other values are reserved for future use)
    • PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual computations allowed for refinement. Default: 10 Aggressive: Set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in err_bnds_norm and err_bnds_comp may no longer be trustworthy. so like… be careful with that one, bestie
    • PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0 (attempt componentwise convergence)
  • WORK β€” WORK is REAL array, dimension (4*N).
  • IWORK β€” IWORK is INTEGER array, dimension (N).
  • INFO β€” INFO is INTEGER
    • = 0: Successful exit. The solution to every right-hand side is guaranteed.
    • < 0: If INFO = -i, the i-th argument had an illegal value
    • > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned.
    • = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides check ERR_BNDS_NORM or ERR_BNDS_COMP. read the whole map, don’t just trust the first red flag 🚩

🌟 Author 🌟

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 410 of file sgerfsx.f.


🌈 subroutine zgerfsx 🌈

   subroutine zgerfsx (character trans, character equed, integer n, integer
       nrhs, complex*16, dimension( lda, * ) a, integer lda, complex*16,
       dimension( ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv,
       double precision, dimension( * ) r, double precision, dimension( * ) c,
       complex*16, dimension( ldb, * ) b, integer ldb, complex*16, dimension(
       ldx , * ) x, integer ldx, double precision rcond, double precision,
       dimension( * ) berr, integer n_err_bnds, double precision, dimension(
       nrhs, * ) err_bnds_norm, double precision, dimension( nrhs, * )
       err_bnds_comp, integer nparams, double precision, dimension( * ) params,
       complex*16, dimension( * ) work, double precision, dimension( * ) rwork,
       integer info)

✨ ZGERFSX ✨

Purpose:

okay so this is the glow-up function β€” ZGERFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. it’s giving β€œtrust me, but also here’s the receipt” energy 🧾✨

The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system.

Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. defaults are lowkey iconic for a reason πŸ’…

πŸ’– Parameters πŸ’–

  • TRANS β€” TRANS is CHARACTER*1. Specifies the form of the system of equations:
    • = 'N': A * X = B (No transpose)
    • = 'T': A**T * X = B (Transpose)
    • = 'C': A**H * X = B (Conjugate transpose)
  • EQUED β€” EQUED is CHARACTER*1. Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.
    • = 'N': No equilibration
    • = 'R': Row equilibration, i.e., A has been premultiplied by diag(R).
    • = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).
    • = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.
  • N β€” N is INTEGER. The order of the matrix A. N >= 0.
  • NRHS β€” NRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • A β€” A is COMPLEX*16 array, dimension (LDA,N). The original N-by-N matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF β€” AF is COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
  • LDAF β€” LDAF is INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV β€” IPIV is INTEGER array, dimension (N). The pivot indices from ZGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
  • R

R β€” DOUBLE PRECISION array, dimension (N)

okay so R is where the row scale factors for A live πŸ’… If EQUED = 'R' or EQUED = 'B', then A gets multiplied on the left by diag(R) β€” slay. But if EQUED = 'N' or EQUED = 'C', bestie… R is not accessed at all, it's giving "you weren't invited to this party" πŸ™ˆ

If R is accessed, every element of R should be a power of the radix, and that's literally the whole point β€” it's what keeps your solution and error estimates reliable ✨ Scaling by powers of the radix causes no rounding errors unless the result underflows or overflows. But rounding errors during scaling? Bestie, they lead to refining with a matrix that is not equivalent to the input matrix, and then your error estimates may not be reliable 😭 periodt.


C β€” DOUBLE PRECISION array, dimension (N)

Same energy, column era πŸŽ€ C holds the column scale factors for A. If EQUED = 'C' or EQUED = 'B', A is multiplied on the right by diag(C); and if EQUED = 'N' or EQUED = 'R', C is not accessed, no cap πŸ™…β€β™€οΈ

And fr fr, the same rule as R: if C is accessed, each element of C should be a power of the radix so your solution and error estimates stay reliable. Scaling by powers of the radix doesn't cause rounding errors unless the result underflows or overflows, and rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix β€” which produces error estimates that may not be reliable πŸ’€


B β€” COMPLEX16 array, dimension (LDB,NRHS)*

the right hand side matrix B. that's it, that's the whole vibe 🫢


LDB β€” INTEGER

the leading dimension of the array B. and it better be LDB >= max(1,N) β€” that's not a suggestion, it's a vibe check πŸ‘‘


X β€” COMPLEX16 array, dimension (LDX,NRHS)*

the main character of this whole routine honestly 🌟 On entry, X is the solution matrix, as computed by ZGETRS. On exit? It's the improved solution matrix X. glow-up arc, literally πŸ’–


LDX β€” INTEGER

leading dimension of the array X, and same deal: LDX >= max(1,N) πŸŽ€


RCOND β€” DOUBLE PRECISION

the reciprocal scaled condition number πŸ¦‹ It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that happened). If this is less than the machine precision β€” and especially if it's zero β€” then the matrix is singular to working precision 😭 but wait, plot twist: the error may still be small even if this number is very small and the matrix appears ill-conditioned. so don't panic-pass-judgment too fast, iykyk πŸ’…


BERR β€” DOUBLE PRECISION array, dimension (NRHS)

componentwise relative backward error ✨ Specifically, the componentwise relative backward error of each solution vector X(j) β€” i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution. tiny chaos, huge meaning 🌸


N_ERR_BNDS β€” INTEGER

how many error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below πŸ‘‡


ERR_BNDS_NORM β€” DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)

for each right-hand side, this array is packed with info about various error bounds and condition numbers corresponding to the normwise relative error, which is defined like this:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned πŸŽ€

The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side.

The second index in ERR_BNDS_NORM(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * dlamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error, so long as the next entry is greater than the threshold sqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true πŸ‘€
  • err = 3 β€” reciprocal condition number: estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is . (the source literally drops a word there, bestie, I'm not making this up 🫠*)* These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

See Lapack Working Note 165 for further details and extra cautions ⭐


ERR_BNDS_COMP β€” DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)

same cute little container, but for the componentwise relative error. For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, defined as:

               abs(XTRUE(j,i) - X(j,i))
        max_j ----------------------
                    abs(X(j,i))

The array is indexed by the right-hand side i (which is what the componentwise relative error depends on) and the type of error information described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed πŸ™ˆ And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERR_BNDS_COMP(i,:) corresponds to the *i*th right-hand side.

The second index in ERR_BNDS_COMP(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * dlamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error, so long as the next entry is greater than the threshold sqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true πŸ‘‘
  • err = 3 β€” reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is . (same dropped word, same energy 🫠*)* These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

See Lapack Working Note 165 for further details and extra cautions πŸ’œ


NPARAMS β€” INTEGER

tells you how many parameters are actually set in PARAMS πŸŽ€ If it's <= 0, then the PARAMS array is never referenced and default values are used. avoiding the whole conversation, iconic 🌈


PARAMS β€” DOUBLE PRECISION array, dimension NPARAMS

this is where the algorithm parameters live, bestie. If an entry is < 0.0, then that entry gets filled with the default value used for that parameter 🌸 Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.

  • PARAMS(LA_LINRX_ITREF_I = 1) β€” whether to perform iterative refinement or not. Default: 1.0D+0
    • = 0.0: no refinement is performed, and no error bounds are computed.
    • = 1.0: use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION.
    • (other values are reserved for future use)
  • PARAMS(LA_LINRX_ITHRESH_I = 2) β€” maximum number of residual computations allowed for refinement. Default: 10 Aggressive: set to 100 to permit convergence using approximate factorizations or factorizations other than LU. ⚠️ But if the factorization uses a technique other than Gaussian elimination, the guarantees in err_bnds_norm and err_bnds_comp may no longer be trustworthy. like, actually not trustworthy, so don't come crying πŸ’€
  • PARAMS(LA_LINRX_CWISE_I = 3) β€” flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0 (attempt componentwise convergence) ✨

WORK β€” COMPLEX16 array, dimension (2*N)*

scratch space, COMPLEX*16, sized 2*N πŸ¦‹


RWORK β€” DOUBLE PRECISION array, dimension (2N)*

scratch space again, but DOUBLE PRECISION this time, sized 2*N πŸŽ€

  • = 0 β€” successful exit, bestie, and the solution to every right-hand side is guaranteed. slay. ✨
  • < 0 β€” if INFO = -i, then the i-th argument had an illegal value πŸ™ˆ (you passed something cursed, no cap).
  • > 0 and <= N β€” U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned. it's giving "we tried, but the math said no" 😭
  • = N+J β€” the solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported.

okay so here's the nuance, and it's lowkey important πŸ‘‡ If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). And if you want the tea on all of the right-hand sides, check ERR_BNDS_NORM or ERR_BNDS_COMP 🫢


πŸ‘‘ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 410 of file zgerfsx.f.

Author

Generated automatically by Doxygen for LAPACK from the source code.


and that's the whole page, bestie πŸ’– this icon was brought to you by LAPACK Version 3.12.0 on gerfsx(3) β€” go forth and check your INFO values, mwah πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from