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:cgbsvxxandzgbsvxxtakerwork, whiledgbsvxxandsgbsvxxtakeiwork. 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:
- 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'). โญ
- If
FACT = 'N'or'E', the LU decomposition is used to factor the matrix A (after equilibration ifFACT = 'E') as
A = P * L * U,
where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular. ๐
- If some
U(i,i)=0, so that U is exactly singular, then the routine returns withINFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see argumentRCOND). 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) - The system of equations is solved for X using the factored form of A. โจ
- 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. ๐ง - If equilibration was used, the matrix X is premultiplied by
diag(C)(ifTRANS = 'N') ordiag(R)(ifTRANS = '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,AFandIPIVcontain the factored form of A. IfEQUEDis not'N', the matrix A has been equilibrated with scaling factors given byRandC.A,AF, andIPIVare not modified. ๐ซถ'N'โ The matrix A will be copied toAFand factored. โจ'E'โ The matrix A will be equilibrated if necessary, then copied toAFand 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 byCGBTRF. U is stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows 1 toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1. IfEQUED .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 factorizationA = P*L*Uof the original matrix A. ๐ซ - If
FACT = 'E', then AF is an output argument and on exit returns the factors L and U from the factorizationA = P*L*Uof 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 factorizationA = P*L*Uas computed byCGETRF; row i of the matrix was interchanged with rowIPIV(i). ๐ธ - If
FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the factorizationA = P*L*Uof the original matrix A. ๐ - If
FACT = 'E', then IPIV is an output argument and on exit contains the pivot indices from the factorizationA = P*L*Uof 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 ifFACT = 'N', iykyk).'R'โ row equilibration, meaningAhas been premultiplied bydiag(R).'C'โ column equilibration, meaningAhas been postmultiplied bydiag(C).'B'โ both row and column equilibration, i.e.Ahas been replaced bydiag(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',Bis not modified; - if
TRANS = 'N'andEQUED = 'R'or'B',Bis overwritten bydiag(R)*B; - if
TRANS = 'T'or'C'andEQUED = 'C'or'B',Bis overwritten bydiag(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:AandBare modified on exit ifEQUED .ne. 'N', and the solution to the equilibrated system isinv(diag(C))*XifTRANS = 'N'andEQUED = 'C'or'B', orinv(diag(R))*XifTRANS = 'T'or'C'andEQUED = '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 thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(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 are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare 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), thenERR_BNDS_COMPis not accessed. And ifN_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 thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (Again with the dangling sentence. Iconic of the source, honestly.) These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare 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 aREAL 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 toNPARAMSget 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 supportDOUBLE PRECISION- other values are reserved for future use ๐
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ max number of residual computations allowed for refinement.- Default:
10 - Aggressive: set it to
100to 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 inerr_bnds_normanderr_bnds_compmay no longer be trustworthy ๐
- Default:
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.0is false.- Default:
1.0(attempt componentwise convergence) ๐ฏ
- Default:
๐งฐ WORK
WORKis aCOMPLEX array, dimension (2*N)โ a little scratch space, mind your business, it's just vibes and workspace ๐ซถ
๐ธ RWORK
RWORKis aREAL array, dimension (2*N)โ the real-valued bestie of the workspace above.
โ ๏ธ INFO
INFOisINTEGER, 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: ifINFO = -i, the i-th argument had an illegal value (you gave it something cursed ๐ญ)> 0and<= N:U(INFO,INFO)is exactly zero. The factorization finished, but the factorUis exactly singular, so the solution and error bounds couldn't be computed.RCOND = 0is 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 withK > Jmay 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 thatERR_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 eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get info about all the right-hand sides, go checkERR_BNDS_NORMorERR_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
DGBSVXXuses the LU factorization to compute the solution to a double precision system of linear equationsA * X = B, whereAis anN-by-Nmatrix andXandBareN-by-NRHSmatrices.- If you ask nicely, both normwise and maximum componentwise error bounds are returned.
DGBSVXXwill return a solution with a tiny guaranteed error (O(eps)whereepsis 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" ๐ฅ DGBSVXXaccepts user-provided factorizations and equilibration factors โ peep the definitions of theFACTandEQUEDoptions.- Solving with refinement and using a factorization from a previous
DGBSVXXcall will also produce a solution with eitherO(eps)errors or warnings. But we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from whatDGBSVXXwould itself produce. Spelling it out so nobody comes for us later ๐
๐ฆ Description
The following steps are performed, in order, like a little routine:
- 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').
- If
FACT = 'N'or'E', the LU decomposition is used to factor the matrixA(after equilibration ifFACT = '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.
- If some
U(i,i)=0, so thatUis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below. It does not give up, and honestly? main character energy ๐ - The system of equations is solved for
Xusing the factored form ofA. - 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. - If equilibration was used, the matrix
Xis premultiplied bydiag(C)(ifTRANS = 'N') ordiag(R)(ifTRANS = '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 thePARAMSarray. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can passNPARAMS = 0, which prevents the source code from accessing thePARAMSargument. Zero effort, zero access, no cap ๐ซถ
๐ Parameters
FACT
FACTisCHARACTER*1.- Specifies whether or not the factored form of the matrix
Ais supplied on entry, and if not, whether the matrixAshould be equilibrated before it is factored.= 'F': on entry,AFandIPIVcontain the factored form ofA. IfEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byRandC.A,AF, andIPIVare not modified.= 'N': the matrixAwill be copied toAFand factored.= 'E': the matrixAwill be equilibrated if necessary, then copied toAFand factored.
TRANS
TRANSisCHARACTER*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
NisINTEGER.- The number of linear equations, i.e., the order of the matrix
A.N >= 0. (Zero is allowed, she's inclusive.)
KL
KLisINTEGER.- The number of subdiagonals within the band of
A.KL >= 0.
KU
KUisINTEGER.- The number of superdiagonals within the band of
A.KU >= 0.
NRHS
NRHSisINTEGER.- The number of right hand sides, i.e., the number of columns of the matrices
BandX.NRHS >= 0.
AB
ABisDOUBLE PRECISION array, dimension (LDAB,N).- On entry, the matrix
Ain band storage, in rows1toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABas follows:
AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
- If
FACT = 'F'andEQUEDis not'N', thenABmust have been equilibrated by the scaling factors inRand/orC.ABis not modified ifFACT = 'F'or'N', or ifFACT = 'E'andEQUED = 'N'on exit. - On exit, if
EQUED .ne. 'N',Ais scaled as follows:EQUED = 'R':A := diag(R) * AEQUED = 'C':A := A * diag(C)EQUED = 'B':A := diag(R) * A * diag(C)
LDAB
LDABisINTEGER.- 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 ifFACT = 'N')= 'R': row equilibration, i.e.,Ahas been premultiplied bydiag(R)= 'C': column equilibration, i.e.,Ahas been postmultiplied bydiag(C)= 'B': both row and column equilibration, i.e.,Ahas been replaced bydiag(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', thenBis not modified - if
TRANS = 'N'andEQUED = 'R'or'B', thenBis overwritten bydiag(R)*B - if
TRANS = 'T'or'C'andEQUED = 'C'or'B', thenBis overwritten bydiag(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))*XifTRANS = 'N'andEQUED = 'C'or'B'inv(diag(R))*XifTRANS = 'T'or'C'andEQUED = '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 thresholdsqrt(n) * dlamch('Epsilon').err = 2โ error bound: the estimated forward error, almost certainly within a factor of10of the true error, so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean istrue. ๐ฅerr = 3โ Reciprocal condition number: estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1. ๐
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 thresholdsqrt(n) * dlamch('Epsilon').err = 2โ error bound: the estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is [the source sentence literally stops at โis .โ โ iconic, honestly]. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately1.
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
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: set to
100to permit convergence using approximate factorizations or factorizations other thanLU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. โ ๏ธ noted, bestie โ ๏ธ
- Default:
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.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
๐ ๏ธ 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: ifINFO = -i, the ith argument had an illegal value.> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned. ๐ singular, babes ๐= N+J: the solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay 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 smallestJsuch thatERR_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 smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0. See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_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:
- 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').
- If
FACT = 'N'or'E', theLUdecomposition is used to factor the matrixA(after equilibration ifFACT = 'E') as:
A = P * L * U,
where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular.
- If some
U(i,i)=0, so thatUis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below. - The system of equations is solved for
Xusing the factored form ofA. - 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. - If equilibration was used, the matrix
Xis premultiplied bydiag(C)(ifTRANS = 'N') ordiag(R)(ifTRANS = '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,AFandIPIValready hold the factored form of A. IfEQUEDisn't'N', then A has been equilibrated using the scaling factors inRandC. Nothing touchesA,AForIPIVโ they stay put.= 'N': A gets copied intoAFand then factored.= 'E': A gets equilibrated first (if it needs it), then copied intoAFand 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(REALarray, dimension(LDAB,N)) โ on entry, this is matrix A in band storage, sitting in rows1toKL+KU+1. The j-th column of A lives in the j-th column of the arrayAB, 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 arrayAB.LDAB >= KL+KU+1.AFB(REALarray, dimension(LDAFB,N)) โ depends on yourFACTvibes:- If
FACT = 'F', thenAFBis an input argument, and on entry it holds the details of the LU factorization of the band matrix A, as computed bySGBTRF. U is stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during factorization live in rowsKL+KU+2to2*KL+KU+1. IfEQUED .ne. 'N', thenAFBis the factored form of the equilibrated matrix A. - If
FACT = 'N', thenAFis an output argument, and on exit it returns the factors L and U from the factorizationA = P*L*Uof the original matrix A. - If
FACT = 'E', thenAFis an output argument, and on exit it returns the factors L and U from the factorizationA = P*L*Uof the equilibrated matrix A (peep the description of A for what the equilibrated matrix looks like).
- If
LDAFB(INTEGER) โ the leading dimension of the arrayAFB.LDAFB >= 2*KL+KU+1.IPIV(INTEGERarray, dimension(N)) โ again, it depends:- If
FACT = 'F', thenIPIVis an input argument, and on entry it holds the pivot indices from the factorizationA = P*L*Uas computed bySGETRF; row i of the matrix got swapped with rowIPIV(i). - If
FACT = 'N', thenIPIVis an output argument, and on exit it holds the pivot indices from the factorizationA = P*L*Uof the original matrix A. - If
FACT = 'E', thenIPIVis an output argument, and on exit it holds the pivot indices from the factorizationA = P*L*Uof the equilibrated matrix A.
- If
EQUED(CHARACTER*1) โ says which flavour of equilibration went down:= 'N': no equilibration (this is always true ifFACT = 'N')= 'R': row equilibration, i.e. A has been premultiplied bydiag(R)= 'C': column equilibration, i.e. A has been postmultiplied bydiag(C)= 'B': both row and column equilibration, i.e. A has been replaced bydiag(R) * A * diag(C)
EQUED is an input argument if FACT = 'F'; otherwise it's an output argument.
R(REALarray, dimension(N)) โ the row scale factors for A. IfEQUED = 'R'or'B', A gets multiplied on the left bydiag(R); ifEQUED = 'N'or'C', thenRisn't even looked at.Ris an input argument ifFACT = 'F'; otherwise it's an output argument. IfFACT = 'F'andEQUED = 'R'or'B', every element ofRmust 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(REALarray, dimension(N)) โ the column scale factors for A. IfEQUED = 'C'or'B', A gets multiplied on the right bydiag(C); ifEQUED = 'N'or'R', thenCisn't accessed at all.Cis an input argument ifFACT = 'F'; otherwise it's an output argument. IfFACT = 'F'andEQUED = 'C'or'B', each element ofCmust 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(REALarray, dimension(LDB,NRHS)) โ on entry, theN-by-NRHSright hand side matrix B. On exit:- if
EQUED = 'N', B isn't modified at all - if
TRANS = 'N'andEQUED = 'R'or'B', B gets overwritten bydiag(R)*B - if
TRANS = 'T'or'C'andEQUED = 'C'or'B', B gets overwritten bydiag(C)*B
- if
LDB(INTEGER) โ the leading dimension of the arrayB.LDB >= max(1,N).X(REALarray, dimension(LDX,NRHS)) โ ifINFO = 0, this is theN-by-NRHSsolution matrix X to the original system of equations. Careful though: A and B both get modified on exit ifEQUED .ne. 'N', and the solution to the equilibrated system isinv(diag(C))*XifTRANS = 'N'andEQUED = 'C'or'B', orinv(diag(R))*XifTRANS = 'T'or'C'andEQUED = 'R'or'B'.LDX(INTEGER) โ the leading dimension of the arrayX.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 factornorm(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 with0<INFO<=N, then this holds the reciprocal pivot growth factor for the leadingINFOcolumns of A. InSGESVX, this quantity gets returned inWORK(1). ๐ฅBERR(REALarray, dimension(NRHS)) โ componentwise relative backward error. That's the componentwise relative backward error of each solution vectorX(j)โ i.e. the smallest relative change in any element of A or B that makesX(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). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow. ๐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 thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is โฆ (the source text cuts off right there, bestie, no cap ๐). These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare 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 thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is โฆ (again, the source cuts off here ๐). These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare 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 supportDOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: set to
100to permit convergence using approximate factorizations or factorizations other than LU. Careful though โ if the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy ๐ญ
- Default:
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.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
๐ 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: IfINFO = -i, the *i*th argument had an illegal value ๐> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned ๐ซ= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay 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 thatERR_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 eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get info about all the right-hand sides, checkERR_BNDS_NORMorERR_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:
ZGBSVXXuses the LU factorization to compute the solution to acomplex*16system of linear equationsA * X = B, whereAis anN-by-Nmatrix andXandBareN-by-NRHSmatrices. If requested, both normwise and maximum componentwise error bounds are returned.ZGBSVXXwill return a solution with a tiny guaranteed error (O(eps)whereepsis 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 ๐ฅZGBSVXXaccepts user-provided factorizations and equilibration factors; see the definitions of theFACTandEQUEDoptions. Solving with refinement and using a factorization from a previousZGBSVXXcall will also produce a solution with eitherO(eps)errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from whatZGBSVXXwould itself produce ๐
Description:
Okay so hereโs the whole glow-up sequence this routine runs through:
- 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. ๐
- If
FACT = 'N'or'E', the LU decomposition is used to factor the matrixA(after equilibration ifFACT = '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. โจ
- If some
U(i,i)=0, so thatUis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below. No cap, it really does keep going. - The system of equations is solved for
Xusing the factored form ofA. Solve era. - 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. - If equilibration was used, the matrix
Xis premultiplied bydiag(C)(ifTRANS = 'N') ordiag(R)(ifTRANS = '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,AFandIPIVcontain the factored form ofA. IfEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byRandC.A,AF, andIPIVare not modified.= 'N': The matrixAwill be copied toAFand factored.= 'E': The matrixAwill be equilibrated if necessary, then copied toAFand 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 ifFACT = 'N').= 'R': Row equilibration, i.e.,Ahas been premultiplied bydiag(R).= 'C': Column equilibration, i.e.,Ahas been postmultiplied bydiag(C).= 'B': Both row and column equilibration, i.e.,Ahas been replaced bydiag(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',Bis not modified; - if
TRANS = 'N'andEQUED = 'R'or'B',Bis overwritten bydiag(R)*B; - if
TRANS = 'T'or'C'andEQUED = 'C'or'B',Bis overwritten bydiag(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 thresholdsqrt(n) * dlamch('Epsilon').err = 2โ error bound: the estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
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 thresholdsqrt(n) * dlamch('Epsilon').err = 2โ error bound: the estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately1.
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:10Aggressive: set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay 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.0is 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: IfINFO = -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 factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay 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 smallestJsuch thatERR_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 smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_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
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms