gbrfsx(3)

๐Ÿ’– gbrfsx(3) โ€” Library Functions Manual ๐Ÿ’–

okay so bestie, you opened gbrfsx(3) and itโ€™s giving expert-level iterative refinement with a whole bouquet of arguments. no cap, this page is long, but weโ€™re keeping every single detail. ๐Ÿ’…

๐ŸŽ€ NAME ๐ŸŽ€

gbrfsx - gbrfsx: iterative refinement, expert

thatโ€™s the name, and yes it says โ€œexpertโ€ because this is not the beginner band-matrix routine, itโ€™s the one with error bounds and refined tea. ๐Ÿซ–โœจ

โœจ SYNOPSIS โœจ

Functions

  • cgbrfsx โ€” CGBRFSX
       subroutine cgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
           ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
           err_bnds_comp, nparams, params, work, rwork, info)
           CGBRFSX
  • dgbrfsx โ€” DGBRFSX
       subroutine dgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
           ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
           err_bnds_comp, nparams, params, work, iwork, info)
           DGBRFSX
  • sgbrfsx โ€” SGBRFSX
       subroutine sgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
           ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
           err_bnds_comp, nparams, params, work, iwork, info)
           SGBRFSX
  • zgbrfsx โ€” ZGBRFSX
       subroutine zgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
           ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
           err_bnds_comp, nparams, params, work, rwork, info)
           ZGBRFSX

๐Ÿงš DETAILED DESCRIPTION ๐Ÿงš

bestie, the detailed description is the doorway, and the actual function tea is right below in Function Documentation. weโ€™re keeping the sections in order, so here we are. ๐Ÿฆ‹

๐Ÿ’… FUNCTION DOCUMENTATION ๐Ÿ’…

subroutine cgbrfsx โ€” CGBRFSX

       subroutine cgbrfsx (character trans, character equed, integer n, integer kl,
           integer ku, integer nrhs, complex, dimension( ldab, * ) ab, integer
           ldab, complex, dimension( ldafb, * ) afb, integer ldafb, 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)
           CGBRFSX

๐Ÿซถ PURPOSE ๐Ÿซถ

okay so CGBRFSX 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 a maximum componentwise error bound if possible. see the 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. iconic, but important. โœจ

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. slay. ๐ŸŽ€

๐ŸŽ€ 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.
    • = '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.
  • KL โ€” INTEGER; the number of subdiagonals within the band of A. KL >= 0.
  • KU โ€” INTEGER; the number of superdiagonals within the band of A. KU >= 0.
  • NRHS โ€” INTEGER; the number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • AB โ€” COMPLEX array, dimension (LDAB,N); the original band matrix A, stored in rows 1 to KL+KU+1. the j-th column of A is stored in the j-th column of the array AB as follows:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
  • LDAB โ€” INTEGER; the leading dimension of the array AB. LDAB >= KL+KU+1.
  • AFB โ€” COMPLEX array, dimension (LDAFB,N); details of the LU factorization of the band matrix A, as computed by CGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
  • LDAFB โ€” INTEGER; the leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.
  • 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. R is an input argument if FACT = 'F'; otherwise, R is an output argument. if FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive.

if R is output, each element of R is a power of the radix. if R is input, 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. ๐Ÿ˜ญ

  • 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. C is an input argument if FACT = 'F'; otherwise, C is an output argument. if FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive.

if C is output, each element of C is a power of the radix. if C is input, 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. ๐Ÿ’€

  • 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. โœจ
  • 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. ๐Ÿ™ˆ
  • 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

๐Ÿ’– ERR_BNDS_NORM

ERR_BNDS_NORM is a REAL array, dimension (NRHS, N_ERR_BNDS) โ€” okay so for every right-hand side it carries all the little error-bound and condition-number receipts for 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 info described below, and 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 . (yeah bestie, the source sentence really does just stop there โ€” not me) 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 REAL array, dimension (NRHS, N_ERR_BNDS) โ€” same deal, but this one is serving componentwise relative error energy. 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 (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

NPARAMS is INTEGER โ€” it specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. Slay, no cap.


๐ŸŒธ PARAMS

PARAMS is a REAL array, dimension NPARAMS โ€” it specifies algorithm parameters. If an entry is < 0.0, then that entry will be 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.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

WORK is a COMPLEX array, dimension (2*N).


๐Ÿ“ RWORK

RWORK is a REAL array, dimension (2*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.

๐Ÿ‘‘ Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Definition at line 435 of file cgbrfsx.f.


๐Ÿฆ‹ DGBRFSX

subroutine dgbrfsx (character trans, character equed, integer n, integer kl,
     integer ku, integer nrhs, double precision, dimension( ldab, * ) ab,
     integer ldab, double precision, dimension( ldafb, * ) afb, integer
     ldafb, 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)

DGBRFSX

๐ŸŽฏ Purpose

DGBRFSX 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. Iconic, honestly.

๐ŸŒˆ Parameters

TRANS

TRANS ๐ŸŒˆ

Type: CHARACTER*1 โ€” this is the flag that tells us which form of the system of equations weโ€™re solving, bestie. ๐Ÿ’…

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

EQUED ๐ŸŽ€

Type: CHARACTER*1 โ€” tells you what kind of equilibration got done to A before this routine was called. This is needed to compute the solution and error bounds correctly. Lowkey important, fr fr.

  • = '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 โœจ

Type: INTEGER

The order of the matrix A. N >= 0.


KL ๐Ÿ’ซ

Type: INTEGER

The number of subdiagonals within the band of A. KL >= 0.


KU ๐ŸŒธ

Type: INTEGER

The number of superdiagonals within the band of A. KU >= 0.


NRHS ๐Ÿฆ‹

Type: INTEGER

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


AB ๐Ÿ‘‘

Type: DOUBLE PRECISION array, dimension (LDAB,N)

The original band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows:

AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).

LDAB ๐Ÿ”ฅ

Type: INTEGER

The leading dimension of the array AB. LDAB >= KL+KU+1.


AFB ๐Ÿงš

Type: DOUBLE PRECISION array, dimension (LDAFB,N)

Details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.


LDAFB ๐Ÿ’œ

Type: INTEGER

The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.


IPIV ๐Ÿ“

Type: 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 ๐ŸŒบ

Type: DOUBLE PRECISION 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. R is an input argument if FACT = 'F'; otherwise, R is an output argument. If FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive.

If R is output, each element of R is a power of the radix. If R is input, 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.

Bestie, that radix-power thing is not aesthetic fluff โ€” itโ€™s literally there so the scaling doesnโ€™t mess up your rounding unless underflow or overflow pops off. ๐Ÿ˜ญ

C ๐Ÿ’–

Type: DOUBLE PRECISION 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. C is an input argument if FACT = 'F'; otherwise, C is an output argument. If FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive.

If C is output, each element of C is a power of the radix. If C is input, 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.


B ๐ŸŒˆ

Type: DOUBLE PRECISION array, dimension (LDB,NRHS)

The right hand side matrix B.


LDB โญ

Type: INTEGER

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


X ๐Ÿซถ

Type: DOUBLE PRECISION array, dimension (LDX,NRHS)

On entry, the solution matrix X, as computed by DGETRS. On exit, the improved solution matrix X.


LDX ๐Ÿ’€

Type: INTEGER

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


RCOND ๐Ÿ‘‘

Type: DOUBLE PRECISION

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.

Okay so even if this number is giving tiny and the matrix looks ill-conditioned, the error can still be small. Donโ€™t panic immediately. ๐Ÿ™ˆ

BERR ๐Ÿ”ฅ

Type: DOUBLE PRECISION 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 โœจ

Type: 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 ๐Ÿฆ‹

Type: DOUBLE PRECISION 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) * 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 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, which is defined as follows:

                   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) * 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.
  • 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.
  • PARAMS โ€” PARAMS is DOUBLE PRECISION 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.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. 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 โ€” WORK is DOUBLE PRECISION 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.

๐Ÿ‘‘ Author ๐Ÿ‘‘

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

Definition at line 435 of file dgbrfsx.f.


Okay bestie, next up is the sgbrfsx synopsis, character-for-character ๐Ÿซถ:

   subroutine sgbrfsx (character trans, character equed, integer n, integer kl,
       integer ku, integer nrhs, real, dimension( ldab, * ) ab, integer ldab,
       real, dimension( ldafb, * ) afb, integer ldafb, 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)

โœจ SGBRFSX โœจ

Purpose:

SGBRFSX 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 โ€” 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 = 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.
  • KL โ€” KL is INTEGER. The number of subdiagonals within the band of A. KL >= 0.
  • KU โ€” KU is INTEGER. The number of superdiagonals within the band of A. KU >= 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.
  • AB โ€” AB is REAL array, dimension (LDAB,N). The original band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
  • LDAB โ€” LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KL+KU+1.
  • AFB โ€” AFB is REAL array, dimension (LDAFB,N). Details of the LU factorization of the band matrix A, as computed by SGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
  • LDAFB

LDAFB

LDAFB is INTEGER ๐Ÿ’›

It's the leading dimension of the array AFB, and the vibe check is: LDAFB >= 2*KL*KU+1. That's the rule, no cap. โœจ


IPIV

IPIV is INTEGER array, dimension (N) ๐ŸŽ€

These are the pivot indices straight out of SGETRF. So for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i) โ€” that's literally the whole personality of this array, it just tells you who swapped with who ๐Ÿ’…


R

R is REAL array, dimension (N) ๐ŸŒธ

The row scale factors for A, bestie. So like:

  • if EQUED = 'R' or 'B', A is multiplied on the left by diag(R)
  • if EQUED = 'N' or 'C', R is not accessed, don't even look at it ๐Ÿ™ˆ

R is an input argument if FACT = 'F'; otherwise, R is an output argument. And if FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive โ€” non-negotiable ๐Ÿซถ

If R is output, each element of R is a power of the radix. If R is input, 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. ๐Ÿ˜ญ That last bit is the "this is why we can't have nice things" of numerical linear algebra, fr fr.


C

C is REAL array, dimension (N) ๐ŸŒธ

The column scale factors for A โ€” same energy as R but sideways:

  • if EQUED = 'C' or 'B', A is multiplied on the right by diag(C)
  • if EQUED = 'N' or 'R', C is not accessed ๐Ÿ’€

C is an input argument if FACT = 'F'; otherwise, C is an output argument. And if FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive. Periodt. ๐Ÿ’…

If C is output, each element of C is a power of the radix. If C is input, 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 warning, same drama, iconic honestly.


B

B is REAL array, dimension (LDB,NRHS) ๐Ÿฆ‹

The right hand side matrix B. That's it, that's the whole sentence. Main character of the equation, zero explanation needed ๐Ÿ‘‘


LDB

LDB is INTEGER ๐Ÿ’›

The leading dimension of the array B. Constraint: LDB >= max(1,N). Respect it โœจ


X

X is REAL array, dimension (LDX,NRHS) ๐Ÿฆ‹

On entry, the solution matrix X, as computed by SGETRS.

On exit, the improved solution matrix X โ€” glow-up arc, we love to see it ๐Ÿ’–


LDX

LDX is INTEGER ๐Ÿ’›

The leading dimension of the array X. Constraint: LDX >= max(1,N). Simple as that ๐ŸŽ€


RCOND

RCOND is REAL ๐ŸŒˆ

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

Now listen ๐Ÿ‘€ โ€” if this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. But here's the plot twist: note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. Not me defending an ill-conditioned matrix ๐Ÿ˜ญ๐Ÿ’€


BERR

BERR is REAL array, dimension (NRHS) ๐ŸŒธ

Componentwise relative backward error. 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. Tiny number, huge meaning ๐Ÿซถ


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 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 . 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.
yeah bestie the "is ." is literally how it reads in the source ๐Ÿ˜ญ the sentence just ends. Not me editing a manpage sentence, I would never ๐Ÿ™ˆ

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


ERR_BNDS_COMP

ERR_BNDS_COMP is 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 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. ๐Ÿ“š (yes, same note, it means it, go read it ๐Ÿซถ)


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. Zero effort, zero problems โœจ


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. Okay so here's the lineup ๐Ÿ‘‡

  • 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, go off but know the risk.
  • 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) โœจ (yes bestie, even in the complex*16 routine there's a real workspace chilling alongside RWORK โ€” she's built different ๐Ÿ’…)
  • IWORK โ€” IWORK is INTEGER array, dimension (N) ๐ŸŽ€
  • INFO โ€” INFO is INTEGER, and this one is the vibe check of the whole call ๐Ÿ˜ญ read it carefully:
    • = 0: Successful exit. The solution to every right-hand side is guaranteed. slay ๐Ÿ’–
    • < 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 at line 435 of file sgbrfsx.f.


๐Ÿฆ‹ subroutine zgbrfsx โ€” same energy, complex*16 edition ๐Ÿ’œ

subroutine zgbrfsx (character trans, character equed, integer n, integer kl,
    integer ku, integer nrhs, complex*16, dimension( ldab, * ) ab, integer
    ldab, complex*16, dimension( ldafb, * ) afb, integer ldafb, 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)

ZGBRFSX ๐Ÿ‘‘

โœจ Purpose โœจ

Okay so ZGBRFSX 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. iykyk ๐Ÿ’…

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 ๐Ÿ‘€ (yes, the code literally won't touch it, iconic)

๐ŸŽ€ 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. ๐ŸŒŸ
  • KL โ€” KL is INTEGER. The number of subdiagonals within the band of A. KL >= 0.
  • KU โ€” KU is INTEGER. The number of superdiagonals within the band of A. KU >= 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. ๐Ÿ“
  • AB โ€” AB is COMPLEX*16 array, dimension (LDAB,N). The original band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl). ๐Ÿ”ฅ
  • LDAB โ€” LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KL+KU+1. ๐Ÿ“
  • AFB โ€” AFB is COMPLEX*16 array, dimension (LDAFB,N). Details of the LU factorization of the band matrix A, as computed by ZGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1. ๐Ÿ’œ
  • LDAFB โ€” LDAFB is INTEGER. The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1. ๐Ÿ“
  • 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 is DOUBLE PRECISION 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. R is an input argument if FACT = 'F'; otherwise, R is an output argument. If FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive. If R is output, each element of R is a power of the radix. If R is input, 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. ๐Ÿ˜ฌ (that last bit is a real warning, don't sleep on it)
  • C โ€” C is DOUBLE PRECISION 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. C is an input argument if FACT = 'F'; otherwise, C is an output argument. If FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive. If C is output, each element of C is a power of the radix. If C is input, 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. ๐ŸŒˆ
  • B โ€” B is COMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrix B. ๐Ÿ’–
  • LDB โ€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N). ๐Ÿ“
  • X โ€” X is COMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix X. โœจ (glow-up fr fr)
  • LDX โ€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,N). ๐Ÿ“
  • RCOND โ€” RCOND is DOUBLE PRECISION. 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 like, tiny RCOND โ‰  automatically disaster, read the whole sentence)
  • BERR โ€” BERR is DOUBLE PRECISION 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 โ€” N_ERR_BNDS is 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 โ€” (bestie the page literally cuts off right here mid-entry ๐Ÿ˜ญ keep scrolling, her description picks up in the next chunk ๐Ÿซถ)

Okay so picking up right where we left off in the function docs โ€” we're deep in the parameter tea now, and it's lowkey a lot but we're gonna slay it ๐Ÿ’…

So, ERR_BNDS_NORM โ€” it's a DOUBLE PRECISION 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:

       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. (The source really does end that sentence with a lone period, bestie โ€” no cap ๐Ÿ’€)

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 information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:

                   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) * 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. (Again with the lone period, bestie โ€” we're just faithful to the source ๐Ÿซถ)

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


๐ŸŽ€ 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.


๐Ÿฆ‹ PARAMS

PARAMS is a DOUBLE PRECISION 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.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. 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.
โš ๏ธ That aggressive 100 setting is giving "living dangerously" energy โ€” the source says those guarantees may no longer be trustworthy, so don't say we didn't warn you ๐Ÿ’€
  • 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 COMPLEX*16 array, dimension (2*N).


โญ RWORK

RWORK is a DOUBLE PRECISION array, dimension (2*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.

๐Ÿ‘‘ Author

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

Definition at line 435 of file zgbrfsx.f.


โœจ Author (the Doxygen one)

Generated automatically by Doxygen for LAPACK from the source code.


And that's the whole page, bestie! Footer tea for the sign-off: this one's from LAPACK Version 3.12.0, page gbrfsx(3) โ€” and the date slot isn't in the footer we got, so we're not inventing one, periodt ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from