la_gbrfsx_extended(3)
๐ธ NAME ๐ธ
okay so this is la_gbrfsx_extended(3) from the Library Functions Manual, and the name bit is literally serving:
la_gbrfsx_extendedโla_gbrfsx_extended: step ingbrfsx.
โจ SYNOPSIS โจ
bestie, under Functions we have four precision-flavored subroutines. Same energy, different letter:
๐งธ Functions ๐งธ
cla_gbrfsx_extendedโCLA_GBRFSX_EXTENDEDimproves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution.
subroutine cla_gbrfsx_extended (prec_type, trans_type, n, kl, ku, nrhs,
ab, ldab, afb, ldafb, ipiv, colequ, c, b, ldb, y, ldy, berr_out,
n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond,
ithresh, rthresh, dz_ub, ignore_cwise, info)
dla_gbrfsx_extendedโDLA_GBRFSX_EXTENDEDimproves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution.
subroutine dla_gbrfsx_extended (prec_type, trans_type, n, kl, ku, nrhs,
ab, ldab, afb, ldafb, ipiv, colequ, c, b, ldb, y, ldy, berr_out,
n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond,
ithresh, rthresh, dz_ub, ignore_cwise, info)
sla_gbrfsx_extendedโSLA_GBRFSX_EXTENDEDimproves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution.
subroutine sla_gbrfsx_extended (prec_type, trans_type, n, kl, ku, nrhs,
ab, ldab, afb, ldafb, ipiv, colequ, c, b, ldb, y, ldy, berr_out,
n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond,
ithresh, rthresh, dz_ub, ignore_cwise, info)
zla_gbrfsx_extendedโZLA_GBRFSX_EXTENDEDimproves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution.
subroutine zla_gbrfsx_extended (prec_type, trans_type, n, kl, ku, nrhs,
ab, ldab, afb, ldafb, ipiv, colequ, c, b, ldb, y, ldy, berr_out,
n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond,
ithresh, rthresh, dz_ub, ignore_cwise, info)
๐ซ Detailed Description ๐ซ
okay so here's the map, no cap: we got Function Documentation coming up, and it's giving subroutine details.
๐ซถ Function Documentation ๐ซถ
๐ง subroutine cla_gbrfsx_extended ๐ง
subroutine cla_gbrfsx_extended (integer prec_type, integer trans_type,
integer n, integer kl, integer ku, integer nrhs, complex, dimension(
ldab, * ) ab, integer ldab, complex, dimension( ldafb, * ) afb, integer
ldafb, integer, dimension( * ) ipiv, logical colequ, real, dimension( *
) c, complex, dimension( ldb, * ) b, integer ldb, complex, dimension(
ldy, * ) y, integer ldy, real, dimension( * ) berr_out, integer n_norms,
real, dimension( nrhs, * ) err_bnds_norm, real, dimension( nrhs, * )
err_bnds_comp, complex, dimension( * ) res, real, dimension(*) ayb,
complex, dimension( * ) dy, complex, dimension( * ) y_tail, real rcond,
integer ithresh, real rthresh, real dz_ub, logical ignore_cwise, integer
info)
okay so CLA_GBRFSX_EXTENDED is the main character here: it improves the computed solution to a system of linear equations for general banded matrices by doing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution.
๐ Purpose ๐
CLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by CGBRFSX to perform iterative refinement. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. Peep the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on those error bounds. Note that this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP.
๐ Parameters ๐
PREC_TYPEโPREC_TYPEisINTEGER. It specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P), wherePis aCHARACTER, and:P = 'S'โ SingleP = 'D'โ DoubleP = 'I'โ IndigenousP = 'X'orP = 'E'โ Extra
TRANS_TYPEโTRANS_TYPEisINTEGER. It specifies the transposition operation onA. The value is defined byILATRANS(T), whereTis aCHARACTER, and:T = 'N'โ No transposeT = 'T'โ TransposeT = 'C'โ Conjugate transpose
NโNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.KLโKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUโKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.NRHSโNRHSisINTEGER. The number of right-hand-sides, i.e., the number of columns of the matrixB.ABโABisCOMPLEXarray, dimension(LDAB,N). On entry, it's theN-by-NmatrixAB.LDABโLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= max(1,N).AFBโAFBisCOMPLEXarray, dimension(LDAF,N). It holds the factorsLandUfrom the factorizationA = P*L*Uas computed byCGBTRF.LDAFBโLDAFBisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byCGBTRF; rowiof the matrix was interchanged with rowIPIV(i).COLEQUโCOLEQUisLOGICAL. If.TRUE., then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly.CโCisREALarray, dimension(N). The column scale factors forA. IfCOLEQU = .FALSE.,Cis not accessed. IfCis input, each element ofCshould 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.
Caveat, 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.
BโBisCOMPLEXarray, dimension(LDB,NRHS). The right-hand-side matrixB.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).YโYisCOMPLEXarray, dimension(LDY,NRHS). On entry, it's the solution matrixX, as computed byCGBTRS. On exit, it's the improved solution matrixY.LDYโLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,N).BERR_OUTโBERR_OUTisREALarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom the formula:
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by CLA_LIN_BERR.
N_NORMSโN_NORMSisINTEGER. It determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP).- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
- If
ERR_BNDS_NORMโERR_BNDS_NORMisREALarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2error 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 = 3Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('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 approximately 1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
ERR_BNDS_COMP
ERR_BNDS_COMP โ ok so this one is a REAL array, dimension (NRHS, N_ERR_BNDS), and bestie, for every single right-hand side it's carrying around all the info about various error bounds and condition numbers matching up with the componentwise relative error, which is defined like this:
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 (the one the componentwise relative error depends on, duh) and by the type of error information, as described down below. Right now there are 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. 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.
And 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 . (yep the source just trails off there, not me ๐ญ) These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row ofA*diag(x)by a power of the radix so all absolute row sums of Z are approximately 1.
This subroutine is only responsible for setting the second field above.
See Lapack Working Note 165 for further details and extra cautions. ๐ซถ
RES โ RES is a COMPLEX array, dimension (N). Workspace to hold the intermediate residual.
AYB โ AYB is a REAL array, dimension (N). Workspace. That's it. It's a workspace. It's giving "I'm just here for the vibes" โจ
DY โ DY is a COMPLEX array, dimension (N). Workspace to hold the intermediate solution.
Y_TAIL โ Y_TAIL is a COMPLEX array, dimension (N). Workspace to hold the trailing bits of the intermediate solution. (the crumbs ๐
)
RCOND โ RCOND is REAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't panic automatically, k?
ITHRESH โ ITHRESH is INTEGER. The maximum number of residual computations allowed for refinement. The default is 10. For '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. โ ๏ธ
RTHRESH โ RTHRESH is REAL. Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details.
DZ_UB โ DZ_UB is REAL. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details.
IGNORE_CWISE โ IGNORE_CWISE is LOGICAL. If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
INFO โ INFO is INTEGER.
= 0: Successful exit. ๐< 0: ifINFO = -i, the ith argument toCGBTRShad an illegal value.
Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 403 of file cla_gbrfsx_extended.f.
๐ dla_gbrfsx_extended ๐
subroutine dla_gbrfsx_extended (integer prec_type, integer trans_type,
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, logical
colequ, double precision, dimension( * ) c, double precision, dimension(
ldb, * ) b, integer ldb, double precision, dimension( ldy, * ) y,
integer ldy, double precision, dimension(*) berr_out, integer n_norms,
double precision, dimension( nrhs, * ) err_bnds_norm, double precision,
dimension( nrhs, * ) err_bnds_comp, double precision, dimension(*) res,
double precision, dimension(*) ayb, double precision, dimension(*) dy,
double precision, dimension(*) y_tail, double precision rcond, integer
ithresh, double precision rthresh, double precision dz_ub, logical
ignore_cwise, integer info)
DLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.
Purpose
DLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by DGBRFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP.
Parameters
PREC_TYPE โ PREC_TYPE is INTEGER. Specifies the intermediate precision to be used in refinement. The value is defined by ILAPREC(P) where P is a CHARACTER and P
= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
TRANS_TYPE โ TRANS_TYPE is INTEGER. Specifies the transposition operation on A. The value is defined by ILATRANS(T) where T is a CHARACTER and T
= 'N': No transpose= 'T': Transpose= 'C': Conjugate 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 matrix B.
AB โ AB is DOUBLE PRECISION array, dimension (LDAB,N). On entry, the N-by-N matrix AB.
LDAB โ LDAB is INTEGER. The leading dimension of the array AB. LDBA >= max(1,N). (yes, LDBA, that's literally what it says, I'm not fixing it ๐)
AFB โ AFB is DOUBLE PRECISION array, dimension (LDAFB,N). The factors L and U from the factorization A = P*L*U as computed by DGBTRF.
LDAFB โ LDAFB is INTEGER. The leading dimension of the array AF. LDAFB >= max(1,N).
IPIV โ IPIV is INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by DGBTRF; row i of the matrix was interchanged with row IPIV(i).
COLEQU โ COLEQU is LOGICAL. If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.
C โ C is DOUBLE PRECISION array, dimension (N). The column scale factors for A. If COLEQU = .FALSE., C is not accessed. 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 DOUBLE PRECISION array, dimension (LDB,NRHS). The right-hand-side matrix B.
LDB
(annnd the page cuts off right there mid-parameter โ the docs keep going, bestie, hang tight ๐)
Y
Y is DOUBLE PRECISION array, dimension (LDY,NRHS).
Okay so on entry this is the solution matrix X, the one you already got from DGBTRS ๐
. On exit it's the improved solution matrix Y. Glow-up arc, honestly.
LDY
LDY is INTEGER โ the leading dimension of the array Y. Constraint: LDY >= max(1,N).
Respect the max(1,N), bestie. It's there for a reason โ zero-sized cases are real. ๐ญ
BERR_OUT
BERR_OUT is DOUBLE PRECISION array, dimension (NRHS).
On exit, BERR_OUT(j) holds the componentwise relative backward error for right-hand-side j, calculated from this formula:
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This one is computed by DLA_LIN_BERR. ๐งฎ
N_NORMS
N_NORMS is INTEGER. It decides which error bounds come back (peep ERR_BNDS_NORM and ERR_BNDS_COMP):
- If
N_NORMS >= 1โ return normwise error bounds. - If
N_NORMS >= 2โ return componentwise error bounds too.
ERR_BNDS_NORM
ERR_BNDS_NORM is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS).
For each right-hand side, this array is absolutely packed with info about various error bounds and condition numbers for the normwise relative error, which is defined like this:
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, described down 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) * slamch('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) * 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 (and yeah the original sentence just cuts off there, 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 approximately1.
This subroutine is only responsible for setting the second field above. Don't ask it for the others, it's not that girl.
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 carries info about various error bounds and condition numbers for the componentwise relative error, defined as:
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 (the componentwise relative error depends on it) and the type of error information described below. There currently are up to three pieces of information returned for each right-hand side.
Heads up bestie: 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 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) * slamch('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) * 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 (same cut-off situation, we love a cliffhanger โจ). 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.
This subroutine is only responsible for setting the second field above. Again. It's a one-field wonder.
See Lapack Working Note 165 for further details and extra cautions. ๐
RES
RES is DOUBLE PRECISION array, dimension (N). Workspace to hold the intermediate residual. Very important little guy.
AYB
AYB is DOUBLE PRECISION array, dimension (N). Workspace.
Passing this: this can be the same workspace passed for Y_TAIL. Reuse, reduce, recycle. โป๏ธ
DY
DY is DOUBLE PRECISION array, dimension (N). Workspace to hold the intermediate solution.
Y_TAIL
Y_TAIL is DOUBLE PRECISION array, dimension (N). Workspace to hold the trailing bits of the intermediate solution. The crumbs, the leftovers, the bits that didn't fit โ iconic behaviour honestly.
RCOND
RCOND is DOUBLE PRECISION.
Reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that was done).
๐จ Real talk: 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. Don't panic-delete your code just because RCOND looks tragic. ๐
ITHRESH
ITHRESH is INTEGER.
The maximum number of residual computations allowed for refinement. The default is 10.
For 'aggressive' set it to 100 to permit convergence using approximate factorizations or factorizations other than LU. ๐ฅ
โ ๏ธ But like, if the factorization uses a technique other than Gaussian elimination, the guarantees inERR_BNDS_NORMandERR_BNDS_COMPmay no longer be trustworthy. So go aggressive if you must, just know the receipts get shaky.
RTHRESH
RTHRESH is DOUBLE PRECISION.
Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1.
The default value is 0.5. For 'aggressive' set it to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. ๐ฆ
DZ_UB
DZ_UB is DOUBLE PRECISION.
Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, and we define stable as the relative change in each component being less than DZ_UB.
The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details. ๐
IGNORE_CWISE
IGNORE_CWISE is LOGICAL.
If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. She's giving "turn off the componentwise notifications" energy.
INFO
INFO is INTEGER.
= 0: Successful exit. ๐< 0: ifINFO = -i, the ith argument toDGBTRShad an illegal value. Yeah, someone passed something cursed toDGBTRSโ go check argument numberi. ๐
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 404 of file dla_gbrfsx_extended.f. ๐
๐ธ subroutine sla_gbrfsx_extended ๐ธ
Single-precision sibling has entered the chat. Same energy, different letters:
subroutine sla_gbrfsx_extended (integer prec_type, integer trans_type,
integer n, integer kl, integer ku, integer nrhs, real, dimension( ldab,
* ) ab, integer ldab, real, dimension( ldafb, * ) afb, integer ldafb,
integer, dimension( * ) ipiv, logical colequ, real, dimension( * ) c,
real, dimension( ldb, * ) b, integer ldb, real, dimension( ldy, * ) y,
integer ldy, real, dimension(*) berr_out, integer n_norms, real,
dimension( nrhs, * ) err_bnds_norm, real, dimension( nrhs, * )
err_bnds_comp, real, dimension(*) res, real, dimension(*) ayb, real,
dimension(*) dy, real, dimension(*) y_tail, real rcond, integer ithresh,
real rthresh, real dz_ub, logical ignore_cwise, integer info)
SLA_GBRFSX_EXTENDED improves the computed solution to a system of linear
equations for general banded matrices by performing extra-precise
iterative refinement and provides error bounds and backward error
estimates for the solution.
So SLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded matrices by doing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution. Same deal as the double-precision one, just in REAL. ๐ง
Purpose:
For real, SLA_GBRFSX_EXTENDED is the glow-up routine โ it takes a solution to a system of linear equations and makes it better by doing extra-precise iterative refinement, and it also hands you error bounds and backward error estimates for that solution. She's the one SGBRFSX calls when it needs iterative refinement done, iykyk. And bestie, it doesn't just do normwise error bounds โ it gives you the maximum componentwise error bound too, when possible. ๐
The full deets on those bounds live in the comments for ERR_BNDS_NORM and ERR_BNDS_COMP, so go read those (they're right below, don't skip ๐
). One thing to keep in your head though: this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP. That's her whole lane. Periodt.
๐ธ PARAMETERS ๐ธ
PREC_TYPE ๐๏ธ
PREC_TYPE is INTEGER
Specifies the intermediate precision to be used in refinement, no cap. The value is defined by ILAPREC(P) where P is a CHARACTER, and P goes like:
'S'โ Single'D'โ Double'I'โ Indigenous'X'or'E'โ Extra
TRANS_TYPE ๐
TRANS_TYPE is INTEGER
Specifies the transposition operation on A. The value is defined by ILATRANS(T) where T is a CHARACTER, and T goes like:
'N'โ No transpose'T'โ Transpose'C'โ Conjugate 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 matrix B. Yes bestie, plural right-hand-sides, she multitasks.
AB ๐งฑ
AB is REAL array, dimension (LDAB,N)
On entry, the N-by-N matrix AB.
LDAB ๐
LDAB is INTEGER
The leading dimension of the array AB. LDAB >= max(1,N).
AFB ๐๏ธ
AFB is REAL array, dimension (LDAFB,N)
The factors L and U from the factorization A = P*L*U, as computed by SGBTRF. Slay, precomputed.
LDAFB ๐
LDAFB is INTEGER
The leading dimension of the array AF. LDAFB >= max(1,N).
IPIV ๐
IPIV is INTEGER array, dimension (N)
The pivot indices from the factorization A = P*L*U as computed by SGBTRF; row i of the matrix was interchanged with row IPIV(i). That's the whole tea.
COLEQU โ๏ธ
COLEQU is LOGICAL
If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly โ so like, don't lie about it, the math is watching.
C ๐ง
C is REAL array, dimension (N)
The column scale factors for A. If COLEQU = .FALSE., C is not accessed (she's not even looking at it). If C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates.
Real talk: scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. So don't be messy with it ๐ญ
B ๐ฏ
B is REAL array, dimension (LDB,NRHS)
The right-hand-side matrix B. Iconic, essential, main character.
LDB ๐
LDB is INTEGER
The leading dimension of the array B. LDB >= max(1,N).
Y โจ
Y is REAL array, dimension (LDY,NRHS)
On entry, the solution matrix X, as computed by SGBTRS. On exit, the improved solution matrix Y. So she walks in as X and leaves as Y โ that's the arc, that's the character development.
LDY ๐
LDY is INTEGER
The leading dimension of the array Y. LDY >= max(1,N).
BERR_OUT ๐
BERR_OUT is REAL array, dimension (NRHS)
On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j, from the formula:
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by SLA_LIN_BERR. Give her her flowers ๐ท
N_NORMS ๐งฎ
N_NORMS is INTEGER
Determines which error bounds to return (see ERR_BNDS_NORM and ERR_BNDS_COMP).
- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
Basically a vibe check on how much you want back.
ERR_BNDS_NORM ๐
ERR_BNDS_NORM is REAL array, dimension (NRHS, N_ERR_BNDS)
For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows.
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the 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. (Yeah, that sentence just stops like that in the source โ not me, not my business ๐) 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.
Heads up: this subroutine is only responsible for setting the second field above. And see Lapack Working Note 165 for further details and extra cautions โ go read it, bestie, it's giving required reading ๐
ERR_BNDS_COMP ๐ฆ
ERR_BNDS_COMP is REAL array, dimension (NRHS, N_ERR_BNDS)
For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows.
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed โ she simply is not invited. 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) * 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, sentence just ends there, love that for us ๐ซ ) 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.
Same deal as above: this subroutine is only responsible for setting the second field. See Lapack Working Note 165 for further details and extra cautions.
RES ๐ซง
RES is REAL array, dimension (N)
Workspace to hold the intermediate residual. Just a lil holding pen, no thoughts head empty.
AYB ๐งบ
AYB is REAL array, dimension (N)
Workspace. And listen โ this can be the same workspace passed for Y_TAIL. Sharing is caring, we love efficiency.
DY ๐
DY is REAL array, dimension (N)
Workspace to hold the intermediate solution.
Y_TAIL ๐
Y_TAIL is REAL array, dimension (N)
Workspace to hold the trailing bits of the intermediate solution. The leftovers, the crumbs, the bits that matter ๐
RCOND ๐
and the description for this one carries on in the next chunk โ she's mid-entrance, hold that thought
RCONDโREAL. It's the reciprocal scaled condition number, bestie โ a little estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if equilibration was done, that is). If this number is less than machine precision โ and especially if it's flat-out zero โ then the matrix is singular to working precision. ๐ But plot twist: the error can still be small even when this number is tiny and the matrix is giving full-on ill-conditioned. So don't panic-spiral just from this one number, mkay?ITHRESHโINTEGER. The maximum number of residual computations allowed for refinement. The default is10. For the 'aggressive' setting, crank it to100so it can permit convergence using approximate factorizations or factorizations that aren't LU. โ ๏ธ Heads up though: if the factorization uses a technique other than Gaussian elimination, the guarantees inERR_BNDS_NORMandERR_BNDS_COMPmay no longer be trustworthy. No cap, that's literally what it says.RTHRESHโREAL. This one decides when to stop refining if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i)wherenorm(Z)is the infinity norm ofZ.RTHRESHsatisfies0 < RTHRESH <= 1. The default value is0.5. For 'aggressive', set it to0.9to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. ๐DZ_UBโREAL. This is the vibe check for when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, and "stable" here means the relative change in each component is less thanDZ_UB. The default value is0.25, which requires the first bit to be stable. See LAWN 165 for more details. โจIGNORE_CWISEโLOGICAL. If.TRUE.then ignore componentwise convergence entirely. Default value is.FALSE.. Live your truth either way, but.FALSE.is the default for a reason.INFOโINTEGER.= 0: Successful exit. ๐< 0: ifINFO = -i, theith argument toSGBTRShad an illegal value.
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 403 of file sla_gbrfsx_extended.f.
๐ subroutine zla_gbrfsx_extended
Okay so now we pivot to the complex*16 era, and honestly? The glow-up is real. ๐
subroutine zla_gbrfsx_extended (integer prec_type, integer trans_type,
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, logical colequ, double
precision, dimension( * ) c, complex*16, dimension( ldb, * ) b, integer
ldb, complex*16, dimension( ldy, * ) y, integer ldy, double precision,
dimension( * ) berr_out, integer n_norms, double precision, dimension(
nrhs, * ) err_bnds_norm, double precision, dimension( nrhs, * )
err_bnds_comp, complex*16, dimension( * ) res, double precision,
dimension(*) ayb, complex*16, dimension( * ) dy, complex*16, dimension(
* ) y_tail, double precision rcond, integer ithresh, double precision
rthresh, double precision dz_ub, logical ignore_cwise, integer info)
ZLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. ๐
๐ฆ Purpose
!>
!> ZLA_GBRFSX_EXTENDED improves the computed solution to a system of
!> linear equations by performing extra-precise iterative refinement
!> and provides error bounds and backward error estimates for the solution.
!> This subroutine is called by ZGBRFSX to perform iterative refinement.
!> In addition to normwise error bound, the code provides maximum
!> componentwise error bound if possible. See comments for ERR_BNDS_NORM
!> and ERR_BNDS_COMP for details of the error bounds. Note that this
!> subroutine is only responsible for setting the second fields of
!> ERR_BNDS_NORM and ERR_BNDS_COMP.
!>
So yeah โ ZGBRFSX calls this icon when it needs the refinement done, and this routine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP. Know your lane, slay your lane. ๐
๐ธ Parameters
PREC_TYPEโINTEGER. Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTER, and:= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
TRANS_TYPEโINTEGER. Specifies the transposition operation onA. The value is defined byILATRANS(T)whereTis aCHARACTER, and:= 'N': No transpose= 'T': Transpose= 'C': Conjugate transpose
NโINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0. (Zero is legal, bestie, don't come for it. ๐ซถ)KLโINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUโINTEGER. The number of superdiagonals within the band ofA.KU >= 0.NRHSโINTEGER. The number of right-hand-sides, i.e., the number of columns of the matrixB.ABโCOMPLEX*16array, dimension(LDAB,N). On entry, theN-by-NmatrixA. ๐LDABโINTEGER. The leading dimension of the arrayA.LDAB >= max(1,N).AFBโCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGBTRF. The wayZGBTRFhanded these to usโฆ iconic. ๐ฅLDAFBโINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byZGBTRF; rowiof the matrix was interchanged with rowIPIV(i). โจCOLEQUโLOGICAL. If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly. Lowkey crucial, ngl.CโDOUBLE PRECISIONarray, dimension(N). The column scale factors forA. IfCOLEQU = .FALSE.,Cis not accessed. IfCis input, each element ofCshould be a power of the radix to ensure a reliable solution and error estimates. ๐ Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. So likeโฆ don't do that.BโCOMPLEX*16array, dimension(LDB,NRHS). The right-hand-side matrixB. ๐งLDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).YโCOMPLEX*16array, dimension(LDY,NRHS). On entry, the solution matrixX, as computed byZGBTRS. On exit, the improved solution matrixY. Glow-up complete. โญLDYโINTEGER. The leading dimension of the arrayY.LDY >= max(1,N).BERR_OUTโDOUBLE PRECISIONarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom the formula
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by ZLA_LIN_BERR. ๐ฅ
N_NORMSโINTEGER. Determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP).- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
- If
ERR_BNDS_NORMโ
ERR_BNDS_NORM is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) โ bestie, for each right-hand side this one holds info about all the error bounds and condition numbers tied to the normwise relative error, and that's defined like this:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the 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 . 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.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
ERR_BNDS_COMP
ERR_BNDS_COMP is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the *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 . 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.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
RES
RES is a COMPLEX*16 array, dimension (N). It's workspace to hold the intermediate residual. ๐ซถ
AYB
AYB is a DOUBLE PRECISION array, dimension (N). Workspace, bestie. โจ
DY
DY is a COMPLEX*16 array, dimension (N). Workspace to hold the intermediate solution.
Y_TAIL
Y_TAIL is a COMPLEX*16 array, dimension (N). Workspace to hold the trailing bits of the intermediate solution โ yes, the little trailing-bit gremlins get their own spot. ๐
RCOND
RCOND is DOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned.
Okay but fr fr, don't panic just because RCOND looks tiny โ the original says the error can still be small even when the matrix appears ill-conditioned. Read the note, bestie. ๐ฉท
ITHRESH
ITHRESH is INTEGER. The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy.
โ ๏ธ That last bit is important: non-Gaussian-elimination factorization can make those guarantees stop being trustworthy. Not me warning you dramatically, but also yes. ๐
RTHRESH
RTHRESH is DOUBLE PRECISION. Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details.
DZ_UB
DZ_UB is DOUBLE PRECISION. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details.
IGNORE_CWISE
IGNORE_CWISE is LOGICAL. If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
INFO
INFO is INTEGER.
= 0: Successful exit. Slay. โ< 0: ifINFO = -i, the *i*th argument toZGBTRShad an illegal value.
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 403 of file zla_gbrfsx_extended.f.
Author ๐ซถ
Generated automatically by Doxygen for LAPACK from the source code.
Okay that's the whole page, bestie โ source: LAPACK, version 3.12.0, and this iconic little manual is la_gbrfsx_extended(3). Kisses, go trust your error bounds responsibly ๐โจ
๐ฆ 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