gbsvxx(3)

๐ŸŒธ gbsvxx(3) โ€” gbsvxx: factor and solve, extra precise ๐Ÿ’…

okay so bestie, this one lives in the Library Functions Manual, section 3 โ€” it's a whole family of LAPACK routines and they're all literally the same vibe in four different flavors (complex, double, single, double-complex). Buckle up. ๐ŸŽ€


โœจ NAME โœจ

gbsvxx โ€” gbsvxx: factor and solve, extra precise ๐Ÿซถ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

Functions

ok so there's four of them, one per precision. here they all are, exactly as written:

subroutine cgbsvxx (fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
    ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds,
    err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)

CGBSVXX computes the solution to system of linear equations A * X = B for GB matrices ๐Ÿ’–

subroutine dgbsvxx (fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
    ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds,
    err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)

DGBSVXX computes the solution to system of linear equations A * X = B for GB matrices โœจ

subroutine sgbsvxx (fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
    ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds,
    err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)

SGBSVXX computes the solution to system of linear equations A * X = B for GB matrices ๐ŸŒˆ

subroutine zgbsvxx (fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
    ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds,
    err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)

ZGBSVXX computes the solution to system of linear equations A * X = B for GB matrices ๐Ÿ‘‘

quick spot-the-difference bestie: cgbsvxx and zgbsvxx take rwork, while dgbsvxx and sgbsvxx take iwork. that's the whole bit. everything else is identical. periodt. ๐Ÿ’…

๐Ÿ’œ Detailed Description ๐Ÿ’œ

Function Documentation

๐Ÿงš subroutine cgbsvxx

subroutine cgbsvxx (character fact, character trans, integer n, integer kl,
    integer ku, integer nrhs, complex, dimension( ldab, * ) ab, integer
    ldab, complex, dimension( ldafb, * ) afb, integer ldafb, integer,
    dimension( * ) ipiv, character equed, real, dimension( * ) r, real,
    dimension( * ) c, complex, dimension( ldb, * ) b, integer ldb, complex,
    dimension( ldx , * ) x, integer ldx, real rcond, real rpvgrw, 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)

CGBSVXX computes the solution to system of linear equations A * X = B for GB matrices ๐Ÿ’–

๐ŸŒŸ Purpose

ok so here's the tea: CGBSVXX uses the LU factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

If you ask for it, you get both normwise and maximum componentwise error bounds back. CGBSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned โ€” in which case a warning is returned instead. The relevant condition numbers also get calculated and returned. we love a routine that tells on itself ๐Ÿซถ

CGBSVXX accepts user-provided factorizations and equilibration factors โ€” peep the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous CGBSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what CGBSVXX would itself produce. no cap, that's a real caveat. ๐Ÿ‘€

๐Ÿ”ฅ Description

The following steps are performed:

  1. If FACT = 'E', real scaling factors are computed to equilibrate the system:
TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B

Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C'). โญ

  1. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as
A = P * L * U,

where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular. ๐ŸŽ€

  1. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see argument RCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for X and compute error bounds as described below. ๐Ÿ’€ (yes it keeps going, she's braver than me)
  2. The system of equations is solved for X using the factored form of A. โœจ
  3. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision. ๐Ÿงš
  4. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration. ๐ŸŒธ

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


๐ŸŽ€ Parameters ๐ŸŽ€

FACT

FACT is CHARACTER*1. It specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored.

  • 'F' โ€” On entry, AF and IPIV contain the factored form of A. If EQUED is not 'N', the matrix A has been equilibrated with scaling factors given by R and C. A, AF, and IPIV are not modified. ๐Ÿซถ
  • 'N' โ€” The matrix A will be copied to AF and factored. โœจ
  • 'E' โ€” The matrix A will be equilibrated if necessary, then copied to AF and factored. ๐Ÿ’–

TRANS

TRANS is CHARACTER*1. It 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) ๐Ÿฆ‹

N

N is INTEGER. The number of linear equations, i.e., 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 array, dimension (LDAB,N).

On entry, the matrix A in band storage, 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)

If FACT = 'F' and EQUED is not 'N', then AB must have been equilibrated by the scaling factors in R and/or C. AB is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.

On exit, if EQUED .ne. 'N', A is scaled as follows:

EQUED = 'R':  A := diag(R) * A
EQUED = 'C':  A := A * diag(C)
EQUED = 'B':  A := diag(R) * A * diag(C).

LDAB

LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KL+KU+1. โœจ

AFB

AFB is COMPLEX array, dimension (LDAFB,N).

  • If FACT = 'F', then AFB is an input argument and on entry contains 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. If EQUED .ne. 'N', then AFB is the factored form of the equilibrated matrix A. ๐Ÿ”ฅ
  • If FACT = 'N', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the original matrix A. ๐Ÿ’ซ
  • If FACT = 'E', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the equilibrated matrix A (see the description of A for the form of the equilibrated matrix). ๐ŸŽ€

LDAFB

LDAFB is INTEGER. The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. ๐Ÿ‘‘

IPIV

IPIV is INTEGER array, dimension (N).

  • If FACT = 'F', then IPIV is an input argument and on entry contains the pivot indices from the factorization A = P*L*U as computed by CGETRF; row i of the matrix was interchanged with row IPIV(i). ๐ŸŒธ
  • If FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the original matrix A. ๐ŸŒŸ
  • If FACT = 'E', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the equilibrated matrix A. ๐Ÿ’–

EQUED

EQUED ๐Ÿ’…

EQUED is CHARACTER*1 and it's basically the receipts of what equilibration got done.

  • 'N' โ€” no equilibration at all (and this is always true if FACT = 'N', iykyk).
  • 'R' โ€” row equilibration, meaning A has been premultiplied by diag(R).
  • 'C' โ€” column equilibration, meaning 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).

EQUED is an input argument if FACT = 'F'; otherwise it's an output argument. Periodt.


R ๐ŸŒธ

R is REAL array, dimension (N) โ€” the row scale factors for A.

If EQUED = 'R' or 'B', A gets multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is simply not accessed, like it's not even invited to the party.

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. And this is the part where it gets real, bestie: 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 ๐Ÿฆ‹

C is REAL array, dimension (N) โ€” the column scale factors for A.

If EQUED = 'C' or 'B', A gets multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. Nothing to see here.

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. Same energy as R, different axis. ๐ŸŽ€


B โœจ

B is COMPLEX array, dimension (LDB,NRHS).

On entry, it's the N-by-NRHS right hand side matrix B. On exit? Depends on the vibe check:

  • if EQUED = 'N', B is not modified;
  • if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
  • if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.

So yeah, B might come back a whole different person. ๐Ÿ™ˆ


LDB ๐Ÿ‘‘

LDB is INTEGER โ€” the leading dimension of the array B.

Constraint, no cap: LDB >= max(1,N).


X ๐Ÿ’œ

X is COMPLEX array, dimension (LDX,NRHS).

If INFO = 0, this is the N-by-NRHS solution matrix X to the original system of equations.

Heads up: A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'. Like, don't forget to un-scale. That's the whole assignment. ๐Ÿ˜ญ

LDX ๐ŸŒˆ

LDX is INTEGER โ€” the leading dimension of the array X.

Constraint: LDX >= max(1,N). Slay.


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 equilibration happened, that is).

If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. But โ€” and this is the 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, just be aware. ๐Ÿ”ฅ


RPVGRW ๐Ÿ“

RPVGRW is REAL โ€” reciprocal pivot growth.

On exit, this contains the reciprocal pivot growth factor norm(A)/norm(U). The norm is used. (Yes, the source text just says "The norm is used." We keep it, we don't question it. ๐Ÿ’€)

If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, estimated condition numbers, and error bounds could be unreliable. Full transparency.

If factorization fails with 0<INFO<=N, then this contains the reciprocal pivot growth factor for the leading INFO columns of A.

Fun crossover fact: in CGESVX, this quantity is returned in RWORK(1). Iykyk. ๐Ÿงš


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 = good vibes.


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, bestie, they're the main characters of the next two entries.


ERR_BNDS_NORM ๐Ÿ‘‘

ERR_BNDS_NORM is 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 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. Read the room, basically.
  • 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 sentence literally trails off there in the source. We're not fixing it, we're just reporting it. ๐Ÿ˜ญ) 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 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, defined as follows:

Componentwise relative error in the *i*th 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.

Two important gotchas: 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) * 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 . (Again with the dangling sentence. Iconic of the source, honestly.) 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. Lowkey the "leave me alone" setting.


PARAMS ๐Ÿซง

โ€ฆaaaaand that's exactly where this chunk of the page runs out โ€” PARAMS picks right back up at the top of the next part, no cap. ๐Ÿ’–

  • PARAMS โ€” it's a REAL array, dimension NPARAMS. It holds the algorithm settings. Ngl the cool part: if any entry is < 0.0, that slot gets auto-filled with the default value for that parameter โœจ. Only positions up to NPARAMS get touched, and anything higher-numbered just uses defaults. Iconic, low-effort behaviour.
    • PARAMS(LA_LINRX_ITREF_I = 1) โ€” do we do iterative refinement or not?
      • Default: 1.0
      • = 0.0: no refinement, and no error bounds computed (so no safety net, bestie ๐Ÿ™ˆ)
      • = 1.0: use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment doesn't support DOUBLE PRECISION
      • other values are reserved for future use ๐Ÿ‘€
    • PARAMS(LA_LINRX_ITHRESH_I = 2) โ€” max number of residual computations allowed for refinement.
      • Default: 10
      • Aggressive: set it to 100 to permit convergence using approximate factorizations or factorizations other than LU. But heads up: 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 for whether the code tries 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) โ€” a little scratch space, mind your business, it's just vibes and workspace ๐Ÿซถ

๐ŸŒธ RWORK

  • RWORK is a REAL array, dimension (2*N) โ€” the real-valued bestie of the workspace above.

โš ๏ธ INFO

  • INFO is INTEGER, and it's the one who tells you how it went:
    • = 0: successful exit, and the solution to every right-hand side is guaranteed โœ…
    • < 0: if INFO = -i, the i-th argument had an illegal value (you gave it something cursed ๐Ÿ˜ญ)
    • > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization finished, but the factor U is exactly singular, so the solution and error bounds couldn't be computed. RCOND = 0 is returned. Fr fr, that matrix is not it.
    • = N+J: the solution corresponding to the J-th right-hand side is not guaranteed. The solutions for other right-hand sides K with K > J may not be guaranteed either, but only the first such right-hand side gets reported. If a small componentwise error wasn't requested (PARAMS(3) = 0.0), then the J-th right-hand side is the first one with a normwise error bound that isn't guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0), the J-th right-hand side is the first one with either a normwise or a componentwise error bound that isn't 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 info about all the right-hand sides, go 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 558 of file cgbsvxx.f. (yes we're literally citing line numbers, respect the lore โœจ)


๐Ÿ’œ subroutine dgbsvxx

Okay so now the double-precision sibling enters the chat, and the signature is a whole meal โ€” read it slowly:

subroutine dgbsvxx (character fact, character trans, 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, character equed, 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 rpvgrw,
    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)

DGBSVXX computes the solution to system of linear equations A * X = B for GB matrices. That's the whole assignment, bestie ๐Ÿ’…

๐ŸŽ€ Purpose

  • DGBSVXX uses the LU factorization to compute the solution to a double precision system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.
  • If you ask nicely, both normwise and maximum componentwise error bounds are returned. DGBSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned โ€” in which case you get a warning. Relevant condition numbers also get calculated and returned. It's giving "we measured everything, you're welcome" ๐Ÿ”ฅ
  • DGBSVXX accepts user-provided factorizations and equilibration factors โ€” peep the definitions of the FACT and EQUED options.
  • Solving with refinement and using a factorization from a previous DGBSVXX call will also produce a solution with either O(eps) errors or warnings. But we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what DGBSVXX would itself produce. Spelling it out so nobody comes for us later ๐Ÿ™

๐Ÿฆ‹ Description

The following steps are performed, in order, like a little routine:

  1. If FACT = 'E', double precision scaling factors are computed to equilibrate the system:
TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B

Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C').

  1. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as:
A = P * L * U,

where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular. Classic factorization slay.

  1. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see argument RCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for X and compute error bounds as described below. It does not give up, and honestly? main character energy ๐Ÿ’…
  2. The system of equations is solved for X using the factored form of A.
  3. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision. Obsessed with that diligence.
  4. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration. Undoing the glow-up so the answer matches what you actually asked ๐Ÿ’–
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. Zero effort, zero access, no cap ๐Ÿซถ

๐ŸŒˆ Parameters

FACT

  • FACT is CHARACTER*1.
  • Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored.
    • = 'F': on entry, AF and IPIV contain the factored form of A. If EQUED is not 'N', the matrix A has been equilibrated with scaling factors given by R and C. A, AF, and IPIV are not modified.
    • = 'N': the matrix A will be copied to AF and factored.
    • = 'E': the matrix A will be equilibrated if necessary, then copied to AF and factored.

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)

N

  • N is INTEGER.
  • The number of linear equations, i.e., the order of the matrix A. N >= 0. (Zero is allowed, she's inclusive.)

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 DOUBLE PRECISION array, dimension (LDAB,N).
  • On entry, the matrix A in band storage, 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)
  • If FACT = 'F' and EQUED is not 'N', then AB must have been equilibrated by the scaling factors in R and/or C. AB is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.
  • On exit, if EQUED .ne. 'N', A is scaled as follows:
    • EQUED = 'R': A := diag(R) * A
    • EQUED = 'C': A := A * diag(C)
    • EQUED = 'B': A := diag(R) * A * diag(C)

LDAB

  • LDAB is INTEGER.
  • The leading dimension of the array AB. LDAB >= KL+KU+1. Respect the band, bestie ๐Ÿ’€

AFB</p>

AFB is a DOUBLE PRECISION array, dimension (LDAFB,N) ๐Ÿ’–

Okay so listen โ€” if FACT = 'F', then AFB is an input argument, and on entry it's carrying the details of the LU factorization of the band matrix A, exactly 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 from the factorization live in rows KL+KU+2 to 2*KL+KU+1. And if EQUED .ne. 'N', then AFB is the factored form of the equilibrated matrix A. โœจ

If FACT = 'N', then AF is an output argument, and on exit it returns the factors L and U from the factorization A = P*L*U of the original matrix A. ๐Ÿซถ

If FACT = 'E', then AF is an output argument, and on exit it returns the factors L and U from the factorization A = P*L*U of the equilibrated matrix A โ€” check the description of A for what the equilibrated matrix looks like, iykyk ๐Ÿ’…


LDAFB</p>

LDAFB is INTEGER โ€” it's the leading dimension of the array AFB, and the rule is LDAFB >= 2*KL+KU+1. No cap, that's the whole vibe check. ๐Ÿฆ‹


IPIV</p>

IPIV is an INTEGER array, dimension (N) ๐ŸŒธ

If FACT = 'F', then IPIV is an input argument, and on entry it holds the pivot indices from the factorization A = P*L*U as computed by DGETRF โ€” row i of the matrix was interchanged with row IPIV(i). literally the receipts of who swapped with who ๐Ÿ˜ญ

If FACT = 'N', then IPIV is an output argument, and on exit it contains the pivot indices from the factorization A = P*L*U of the original matrix A. โœจ

If FACT = 'E', then IPIV is an output argument, and on exit it contains the pivot indices from the factorization A = P*L*U of the equilibrated matrix A. ๐Ÿ’–


EQUED</p>

EQUED is CHARACTER*1 and it specifies the form of equilibration that was done, bestie:

  • = 'N': no equilibration at all (always true if FACT = 'N')
  • = '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) ๐Ÿ‘‘

EQUED is an input argument if FACT = 'F'; otherwise, it's an output argument. ๐ŸŽ€


R</p>

R is a DOUBLE PRECISION array, dimension (N) โ€” the row scale factors for A. ๐Ÿ’œ

If EQUED = 'R' or 'B', then A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', then R is not accessed (she's off the clock, don't @ her ๐Ÿ™ˆ). R is an input argument if FACT = 'F'; otherwise, R is an output argument. And if FACT = 'F' and EQUED = 'R' or 'B', every element of R must be positive, periodt.

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. But ngl โ€” 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. โš ๏ธ


C</p>

C is a DOUBLE PRECISION array, dimension (N) โ€” the column scale factors for A. ๐ŸŒˆ

If EQUED = 'C' or 'B', then A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', then 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 โ€” non-negotiable ๐Ÿ’…

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, different letter, she said it twice for a reason.


B</p>

B is a DOUBLE PRECISION array, dimension (LDB,NRHS) ๐Ÿ“

On entry: the N-by-NRHS right hand side matrix B.

On exit, watch closely bestie:

  • if EQUED = 'N', then B is not modified
  • if TRANS = 'N' and EQUED = 'R' or 'B', then B is overwritten by diag(R)*B
  • if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', then B is overwritten by diag(C)*B ๐Ÿ”ฅ

LDB</p>

LDB is INTEGER โ€” the leading dimension of the array B, and the requirement is LDB >= max(1,N). That's it, that's the whole paragraph, slay. โœจ


X</p>

X is a DOUBLE PRECISION array, dimension (LDX,NRHS) ๐ŸŒธ

If INFO = 0, this is the N-by-NRHS solution matrix X to the original system of equations. Main character energy honestly ๐Ÿ‘‘

But heads up โ€” note that A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is:

  • inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B'
  • inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'

So likeโ€ฆ don't forget to un-equilibrate your answer, babes. ๐Ÿซถ


LDX</p>

LDX is INTEGER โ€” the leading dimension of the array X, and you need LDX >= max(1,N). ๐Ÿฆ‹


RCOND</p>

RCOND is DOUBLE PRECISION โ€” the reciprocal scaled condition number. ๐Ÿ’œ

This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if it was done, no pressure). If this is less than the machine precision โ€” in particular, if it is zero โ€” then the matrix is singular to working precision. ๐Ÿ’€

But wait, small plot twist: 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-close the tab just because RCOND said something mean. ๐Ÿ˜Œ


RPVGRW</p>

RPVGRW is DOUBLE PRECISION โ€” the reciprocal pivot growth. โญ

On exit, this contains the reciprocal pivot growth factor norm(A)/norm(U). The norm is used. (That's what the page says, bestie โ€” that's the bit you get. ๐Ÿ™ˆ)

If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. That also means the solution X, the estimated condition numbers, and the error bounds could be unreliable. Like, the whole squad of outputs is suspect. ๐Ÿ˜ญ

If factorization fails with 0<INFO<=N, then this contains the reciprocal pivot growth factor for the leading INFO columns of A. In DGESVX, this quantity is returned in WORK(1). ๐ŸŽ€


BERR</p>

BERR is a DOUBLE PRECISION array, dimension (NRHS) โ€” the 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. She's asking: how much would I have to fudge reality for this answer to be perfect? ๐Ÿ’…


N_ERR_BNDS</p>

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, bestie, they're the next two sections. ๐Ÿซถ


ERR_BNDS_NORM</p>

ERR_BNDS_NORM 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 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 (currently up to three pieces of information get returned, fyi).

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. fr, go read it if you're doing the math-math ๐Ÿ˜Œ

ERR_BNDS_COMP</p>

So ERR_BNDS_COMP is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS), and bestie it is packed with info. For each right-hand side, it holds various error bounds and condition numbers corresponding to the componentwise relative error, which is defined like this:

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

Thatโ€™s the componentwise relative error in the ith solution vector. The array is indexed by the right-hand side i โ€” because the componentwise relative error depends on it โ€” and by the type of error information described below. There are currently up to three pieces of info returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed at all. 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 these 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 [the source sentence literally stops at โ€œis .โ€ โ€” iconic, honestly]. 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. No touching, no stressing. ๐Ÿซถ

๐ŸŽ›๏ธ PARAMS

PARAMS is a DOUBLE PRECISION 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.0D+0
    • = 0.0: no refinement is performed, and no error bounds are computed.
    • = 1.0: use the extra-precise refinement algorithm.
    • Other values are reserved for future use. iykyk
  • 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. โš ๏ธ noted, 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 a DOUBLE PRECISION array, dimension (4*N). Just space for the algorithm to do its thing.

๐Ÿงฎ IWORK

IWORK is an INTEGER array, dimension (N).

๐Ÿšฆ INFO

INFO is INTEGER.

  • = 0: successful exit. The solution to every right-hand side is guaranteed. slay
  • < 0: if INFO = -i, the ith 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. ๐Ÿ’€ singular, babes ๐Ÿ’€
  • = 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.
This is the โ€œbestie, some of your answers are not guaranteed, check the error-bound arraysโ€ situation. Not a vibe, but very useful info. ๐Ÿซถ

๐Ÿ‘‘ Author

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

๐Ÿ“ Definition at line 555 of file dgbsvxx.f.

๐Ÿฆ‹ subroutine sgbsvxx

subroutine sgbsvxx (character fact, character trans, integer n, integer kl,
     integer ku, integer nrhs, real, dimension( ldab, * ) ab, integer ldab,
     real, dimension( ldafb, * ) afb, integer ldafb, integer, dimension( * )
     ipiv, character equed, real, dimension( * ) r, real, dimension( * ) c,
     real, dimension( ldb, * ) b, integer ldb, real, dimension( ldx , * ) x,
     integer ldx, real rcond, real rpvgrw, 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)

SGBSVXX computes the solution to system of linear equations A * X = B for GB matrices. main character energy fr fr โœจ

๐ŸŽฏ Purpose

SGBSVXX uses the LU factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

If requested, both normwise and maximum componentwise error bounds are returned. SGBSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers also are calculated and returned.

SGBSVXX accepts user-provided factorizations and equilibration factors; see the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous SGBSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what SGBSVXX would itself produce. basically: donโ€™t hand it a random factorization and expect the same guarantees, bestie

๐Ÿง  Description

The following steps are performed:

  1. If FACT = 'E', real scaling factors are computed to equilibrate the system:
TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B

Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C').

  1. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as:
A = P * L * U,

where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular.

  1. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see argument RCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for X and compute error bounds as described below.
  2. The system of equations is solved for X using the factored form of A.
  3. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision.
  4. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration.

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 really said โ€œI got youโ€ ๐Ÿ’…


๐Ÿงฉ Parameters

FACT

  • FACT (CHARACTER*1) โ€” tells the routine whether you're handing it an already-factored matrix A, and if not, whether A should get equilibrated before factoring. Your options:
    • = 'F': on entry, AF and IPIV already hold the factored form of A. If EQUED isn't 'N', then A has been equilibrated using the scaling factors in R and C. Nothing touches A, AF or IPIV โ€” they stay put.
    • = 'N': A gets copied into AF and then factored.
    • = 'E': A gets equilibrated first (if it needs it), then copied into AF and factored.
  • TRANS (CHARACTER*1) โ€” which flavour of system you're solving:
    • = 'N': A * X = B (no transpose)
    • = 'T': A**T * X = B (transpose)
    • = 'C': A**H * X = B (conjugate transpose, which here is just the transpose)
  • N (INTEGER) โ€” how many linear equations you've got, i.e. the order of matrix A. N >= 0. ๐Ÿ’…
  • KL (INTEGER) โ€” the number of subdiagonals inside the band of A. KL >= 0.
  • KU (INTEGER) โ€” the number of superdiagonals inside the band of A. KU >= 0.
  • NRHS (INTEGER) โ€” the number of right hand sides, meaning the number of columns in matrices B and X. NRHS >= 0.
  • AB (REAL array, dimension (LDAB,N)) โ€” on entry, this is matrix A in band storage, sitting in rows 1 to KL+KU+1. The j-th column of A lives in the j-th column of the array AB, like this:
AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)

If FACT = 'F' and EQUED isn't 'N', then AB must already have been equilibrated by the scaling factors in R and/or C. AB does not get modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.

On exit, if EQUED .ne. 'N', A gets scaled like so:

EQUED = 'R':  A := diag(R) * A
EQUED = 'C':  A := A * diag(C)
EQUED = 'B':  A := diag(R) * A * diag(C).
  • LDAB (INTEGER) โ€” the leading dimension of the array AB. LDAB >= KL+KU+1.
  • AFB (REAL array, dimension (LDAFB,N)) โ€” depends on your FACT vibes:
    • If FACT = 'F', then AFB is an input argument, and on entry it holds the 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 factorization live in rows KL+KU+2 to 2*KL+KU+1. If EQUED .ne. 'N', then AFB is the factored form of the equilibrated matrix A.
    • If FACT = 'N', then AF is an output argument, and on exit it returns the factors L and U from the factorization A = P*L*U of the original matrix A.
    • If FACT = 'E', then AF is an output argument, and on exit it returns the factors L and U from the factorization A = P*L*U of the equilibrated matrix A (peep the description of A for what the equilibrated matrix looks like).
  • LDAFB (INTEGER) โ€” the leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.
  • IPIV (INTEGER array, dimension (N)) โ€” again, it depends:
    • If FACT = 'F', then IPIV is an input argument, and on entry it holds the pivot indices from the factorization A = P*L*U as computed by SGETRF; row i of the matrix got swapped with row IPIV(i).
    • If FACT = 'N', then IPIV is an output argument, and on exit it holds the pivot indices from the factorization A = P*L*U of the original matrix A.
    • If FACT = 'E', then IPIV is an output argument, and on exit it holds the pivot indices from the factorization A = P*L*U of the equilibrated matrix A.
  • EQUED (CHARACTER*1) โ€” says which flavour of equilibration went down:
    • = 'N': no equilibration (this is always true if FACT = 'N')
    • = '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)

EQUED is an input argument if FACT = 'F'; otherwise it's an output argument.

  • R (REAL array, dimension (N)) โ€” the row scale factors for A. If EQUED = 'R' or 'B', A gets multiplied on the left by diag(R); if EQUED = 'N' or 'C', then R isn't even looked at. R is an input argument if FACT = 'F'; otherwise it's an output argument. If FACT = 'F' and EQUED = 'R' or 'B', every 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 guarantee a reliable solution and reliable error estimates. Scaling by powers of the radix doesn't cause rounding errors unless the result underflows or overflows โ€” and rounding errors during scaling mean you end up refining with a matrix that isn't equivalent to the input matrix, which gives you error estimates that may not be reliable. ๐Ÿ˜ญ

  • C (REAL array, dimension (N)) โ€” the column scale factors for A. If EQUED = 'C' or 'B', A gets multiplied on the right by diag(C); if EQUED = 'N' or 'R', then C isn't accessed at all. C is an input argument if FACT = 'F'; otherwise it's 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 so you actually get a reliable solution and error estimates. Scaling by powers of the radix doesn't introduce rounding errors unless the result underflows or overflows โ€” and rounding errors during scaling lead to refining with a matrix that isn't equivalent to the input matrix, producing error estimates that may not be reliable. Same whole speech as R, bestie, it's a package deal. ๐Ÿซถ

  • B (REAL array, dimension (LDB,NRHS)) โ€” on entry, the N-by-NRHS right hand side matrix B. On exit:
    • if EQUED = 'N', B isn't modified at all
    • if TRANS = 'N' and EQUED = 'R' or 'B', B gets overwritten by diag(R)*B
    • if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B gets overwritten by diag(C)*B
  • LDB (INTEGER) โ€” the leading dimension of the array B. LDB >= max(1,N).
  • X (REAL array, dimension (LDX,NRHS)) โ€” if INFO = 0, this is the N-by-NRHS solution matrix X to the original system of equations. Careful though: A and B both get modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
  • LDX (INTEGER) โ€” the leading dimension of the array X. LDX >= max(1,N).
  • RCOND (REAL) โ€” the reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if any happened). If this is less than machine precision โ€” and especially if it's zero โ€” then the matrix is singular to working precision. Note that the error may still be small even when this number is teeny-tiny and the matrix looks ill-conditioned. ๐Ÿ™ˆ
  • RPVGRW (REAL) โ€” reciprocal pivot growth. On exit this holds the reciprocal pivot growth factor norm(A)/norm(U). The norm is used. If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. It also means your solution X, your estimated condition numbers, and your error bounds could all be unreliable. If the factorization fails with 0<INFO<=N, then this holds the reciprocal pivot growth factor for the leading INFO columns of A. In SGESVX, this quantity gets returned in WORK(1). ๐Ÿ”ฅ
  • BERR (REAL array, dimension (NRHS)) โ€” componentwise relative backward error. That'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. Slay, tiny error. โœจ
  • N_ERR_BNDS (INTEGER) โ€” the number of error bounds to return for each right hand side and for each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below. ๐Ÿ‘€
  • ERR_BNDS_NORM โ€” okay this one's a whole thing, hold that thought for the next bitโ€ฆ

๐ŸŒธ ERR_BNDS_NORM ๐ŸŒธ

ERR_BNDS_NORM is a REAL array, dimension (NRHS, N_ERR_BNDS) โ€” okay so for each right-hand side, this baby holds all the tea about error bounds and condition numbers for the normwise relative error, which is literally 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, as described below. Right now there are up to three pieces of info coming back at you ๐Ÿ’…

  • 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 these 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 source text cuts off right there, bestie, no cap ๐Ÿ‘€). 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, bestie โ€” fr fr, go read it ๐Ÿซถ

๐Ÿฆ‹ ERR_BNDS_COMP ๐Ÿฆ‹

ERR_BNDS_COMP is a REAL array, dimension (NRHS, N_ERR_BNDS) โ€” same deal, but this one's all about the componentwise relative error, which goes like this:

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

The array is indexed by the right-hand side i (since the componentwise relative error depends on it) and by the type of error info described below. There are currently up to three pieces of info returned for each right-hand side. Important bestie: 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 these 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 โ€ฆ (again, the source cuts off here ๐Ÿ™ˆ). 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, defaults ๐Ÿ’…


โญ 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. Careful though โ€” 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 REAL array, dimension (4*N) โ€” that's it, that's the whole vibe ๐Ÿงš


๐Ÿ’œ IWORK ๐Ÿ’œ

IWORK is an INTEGER array, dimension (N) ๐Ÿ’–


๐Ÿ”ฅ INFO ๐Ÿ”ฅ

INFO is INTEGER. Here's the whole mood ring of possible outcomes:

  • = 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 info about all 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 558 of file sgbsvxx.f. ๐ŸŽ€


๐Ÿ’… subroutine zgbsvxx ๐Ÿ’…

subroutine zgbsvxx (character fact, character trans, 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, character equed, 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 rpvgrw, 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)

ZGBSVXX computes the solution to system of linear equations A * X = B for GB matrices ๐Ÿฆ‹

Purpose:

ZGBSVXX uses the LU factorization to compute the solution to a complex*16 system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices. If requested, both normwise and maximum componentwise error bounds are returned. ZGBSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers also are calculated and returned ๐Ÿ”ฅ ZGBSVXX accepts user-provided factorizations and equilibration factors; see the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous ZGBSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what ZGBSVXX would itself produce ๐Ÿ‘€

Description:

Okay so hereโ€™s the whole glow-up sequence this routine runs through:

  1. If FACT = 'E', it computes double precision scaling factors to equilibrate the system, like this:
TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B

Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C'). Thatโ€™s the whole point of the scaling era. ๐Ÿ’…

  1. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as
A = P * L * U,

where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular. Iconic factorization behavior. โœจ

  1. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see argument RCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for X and compute error bounds as described below. No cap, it really does keep going.
  2. The system of equations is solved for X using the factored form of A. Solve era.
  3. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision. Highkey precise.
  4. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration. Original system restored, periodt. ๐Ÿฆ‹

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 ๐ŸŒธ

FACT โ€” FACT is CHARACTER*1. This specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored. The tea โ˜•:

  • = 'F': On entry, AF and IPIV contain the factored form of A. If EQUED is not 'N', the matrix A has been equilibrated with scaling factors given by R and C. A, AF, and IPIV are not modified.
  • = 'N': The matrix A will be copied to AF and factored.
  • = 'E': The matrix A will be equilibrated if necessary, then copied to AF and factored.

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)

N โ€” N is INTEGER. The number of linear equations, i.e., 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). On entry, the matrix A in band storage, 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)

If FACT = 'F' and EQUED is not 'N', then AB must have been equilibrated by the scaling factors in R and/or C. AB is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.

On exit, if EQUED .ne. 'N', A is scaled as follows:

EQUED = 'R':  A := diag(R) * A
EQUED = 'C':  A := A * diag(C)
EQUED = 'B':  A := diag(R) * A * diag(C).

LDAB โ€” LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KL+KU+1.

AFB โ€” AFB is COMPLEX*16 array, dimension (LDAFB,N). If FACT = 'F', then AFB is an input argument and on entry contains 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. If EQUED .ne. 'N', then AFB is the factored form of the equilibrated matrix A.

If FACT = 'N', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the original matrix A.

If FACT = 'E', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the equilibrated matrix A (see the description of A for the form of the equilibrated matrix).

LDAFB โ€” LDAFB is INTEGER. The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.

IPIV โ€” IPIV is INTEGER array, dimension (N). If FACT = 'F', then IPIV is an input argument and on entry contains the pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i).

If FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the original matrix A.

If FACT = 'E', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the equilibrated matrix A.

EQUED โ€” EQUED is CHARACTER*1. Specifies the form of equilibration that was done:

  • = 'N': No equilibration (always true if FACT = 'N').
  • = '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).

EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument.

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. This is the โ€œhandle with careโ€ part, bestie.

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). On entry, the N-by-NRHS right hand side matrix B. On exit:

  • if EQUED = 'N', B is not modified;
  • if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B;
  • if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*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). If INFO = 0, the N-by-NRHS solution matrix X to the original system of equations. Note that A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.

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

RCOND

๐Ÿ’– RCOND ๐Ÿ’–

RCOND is DOUBLE PRECISION.

It's the reciprocal scaled condition number โ€” an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that was done). If this is less than the machine precision (in particular, if it's zero), then the matrix is singular to working precision.

โš ๏ธ Bestie, note: the error may still be small even if this number is very small and the matrix appears ill-conditioned. Don't panic automatically.

๐Ÿฆ‹ RPVGRW ๐Ÿฆ‹

RPVGRW is DOUBLE PRECISION.

Reciprocal pivot growth. On exit, this contains the reciprocal pivot growth factor norm(A)/norm(U). The norm is used. If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, estimated condition numbers, and error bounds could be unreliable.

If factorization fails with 0<INFO<=N, then this contains the reciprocal pivot growth factor for the leading INFO columns of A. In ZGESVX, this quantity is returned in RWORK(1).

๐ŸŒธ 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 โœจ

ERR_BNDS_NORM is 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 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) * 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 extra-precise refinement algorithm.
    • (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 COMPLEX*16 array, dimension (2*N).

๐Ÿ“ RWORK ๐Ÿ“

RWORK is 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 555 of file zgbsvxx.f.

๐Ÿงš Author ๐Ÿงš

Generated automatically by Doxygen for LAPACK from the source code.


That's the whole gbsvxx(3) tea, bestie โ€” LAPACK Version 3.12.0, auto-generated by Doxygen for LAPACK from the source code. Slay and stay conditioned ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from