la_gerfsx_extended(3)
okay bestie, welcome to la_gerfsx_extended(3) from the Library Functions Manual β this is the LAPACK extended-refinement girlie and she has so much to say π
β¨
πΈ NAME πΈ
la_gerfsx_extended β la_gerfsx_extended: step in gerfsx
β¨ SYNOPSIS β¨
π§ Functions
πΉ cla_gerfsx_extended
subroutine cla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
dz_ub, ignore_cwise, info)
CLA_GERFSX_EXTENDED β that's the whole description in the original, bestie. no extra tea here π«
πΉ dla_gerfsx_extended
subroutine dla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
dz_ub, ignore_cwise, info)
DLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. π₯
πΉ sla_gerfsx_extended
subroutine sla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
dz_ub, ignore_cwise, info)
SLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. π
πΉ zla_gerfsx_extended
subroutine zla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
dz_ub, ignore_cwise, info)
ZLA_GERFSX_EXTENDED β again, that's it in the original, no extra description. she's mysterious π
π« DETAILED DESCRIPTION π«
bestie, the original has this heading and then immediately moves on to Function Documentation β so yeah, it's giving mysterious empty section energy π
π οΈ FUNCTION DOCUMENTATION π οΈ
πΈ subroutine cla_gerfsx_extended πΈ
subroutine cla_gerfsx_extended (integer prec_type, integer trans_type,
integer n, integer nrhs, complex, dimension( lda, * ) a, integer lda,
complex, dimension( ldaf, * ) af, integer ldaf, 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, * )
errs_n, real, dimension( nrhs, * ) errs_c, 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)
CLA_GERFSX_EXTENDED
π― Purpose
okay so CLA_GERFSX_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. she's called by CGERFSX to perform iterative refinement. π«Ά
in addition to normwise error bound, the code provides maximum componentwise error bound if possible. see the comments for ERRS_N and ERRS_C for details of the error bounds. note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. periodt. π
π§Ύ Parameters
PREC_TYPEβINTEGER. specifies the intermediate precision to be used in refinement. the value is defined byILAPREC(P)wherePis aCHARACTERandP='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 aCHARACTERandT='N': No transpose, ='T': Transpose, ='C': Conjugate transpose. π¦NβINTEGER. the number of linear equations, i.e., the order of the matrixA.N >= 0. πNRHSβINTEGER. the number of right-hand-sides, i.e., the number of columns of the matrixB. πΈAβCOMPLEX array, dimension (LDA,N). on entry, theN-by-NmatrixA. πLDAβINTEGER. the leading dimension of the arrayA.LDA >= max(1,N). πAFβCOMPLEX array, dimension (LDAF,N). the factorsLandUfrom the factorizationA = P*L*Uas computed byCGETRF. π₯LDAFβINTEGER. the leading dimension of the arrayAF.LDAF >= max(1,N). βIPIVβINTEGER array, dimension (N). the pivot indices from the factorizationA = P*L*Uas computed byCGETRF; 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. πCβREAL array, 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. πBβCOMPLEX array, dimension (LDB,NRHS). the right-hand-side matrixB. π§LDBβINTEGER. the leading dimension of the arrayB.LDB >= max(1,N). πYβCOMPLEX array, dimension (LDY,NRHS). on entry, the solution matrixX, as computed byCGETRS. on exit, the improved solution matrixY. πLDYβINTEGER. the leading dimension of the arrayY.LDY >= max(1,N). πBERR_OUTβREAL array, dimension (NRHS). on exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom the formulamax(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )whereabs(Z)is the componentwise absolute value of the matrix or vectorZ. this is computed byCLA_LIN_BERR. πN_NORMSβINTEGER. determines which error bounds to return (seeERRS_NandERRS_C). ifN_NORMS >= 1return normwise error bounds. ifN_NORMS >= 2return componentwise error bounds. π«ΆERRS_Nβ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 ERRS_N(i,:) corresponds to the ith right-hand side.
the second index in ERRS_N(:,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 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 = 3reciprocal condition number: estimated normwise reciprocal condition number. compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (yes bestie, the original literally has a space before that period β we don't make the rules, we just report them π) 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. see Lapack Working Note 165 for further details and extra cautions. π
ERRS_C
(and that's where part 1 stops β part 2 has the rest of ERRS_C and beyond, no cap)
ERRS_C(REAL array, dimension (NRHS, N_ERR_BNDS)) β bestie this one is the whole componentwise situation π For each right-hand side, it holds info about the various error bounds and condition numbers that correspond to 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 (because that's what the componentwise relative error depends on, duh), and then by the type of error info, described 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 ERRS_C is not accessed at all β like, it's not even invited to the party. And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERRS_C(i,:) corresponds to the ith right-hand side.
The second index in ERRS_C(:,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 istrue.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 approximately1.
And listen β this subroutine is only responsible for setting the second field above. That's it, that's the job π«‘ See Lapack Working Note 165 for further details and extra cautions.
RES(COMPLEX array, dimension (N)) β workspace to hold the intermediate residual. Scratching pad energy πAYB(REAL array, dimension (N)) β workspace. That's it. That's the whole description. Iconic minimalism β¨DY(COMPLEX array, dimension (N)) β workspace to hold the intermediate solution.Y_TAIL(COMPLEX array, dimension (N)) β workspace to hold the trailing bits of the intermediate solution. The crumbs, basically πRCOND(REAL) β Reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if equilibration was done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision π Note though β the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't panic-spiral prematurely, k?ITHRESH(INTEGER) β The maximum number of residual computations allowed for refinement. The default is10. For 'aggressive' set it to100to permit convergence using approximate factorizations or factorizations other than LU. β οΈ But fr fr: if the factorization uses a technique other than Gaussian elimination, the guarantees inERRS_NandERRS_Cmay no longer be trustworthy. No cap.RTHRESH(REAL) β Determines when to stop refinement 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) β Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, which we define as the relative change in each component being less thanDZ_UB. The default value is0.25, requiring the first bit to be stable. See LAWN 165 for more details π¦IGNORE_CWISE(LOGICAL) β If.TRUE.then ignore componentwise convergence. Default value is.FALSE..INFO(INTEGER) β= 0: Successful exit π< 0: ifINFO = -i, the ith argument toCGETRShad an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 391 of file cla_gerfsx_extended.f.
π subroutine dla_gerfsx_extended π
Bestie, here's the whole signature, and yes it's a lot β read it slowly, it's giving very long but very precise:
subroutine dla_gerfsx_extended (integer prec_type, integer trans_type,
integer n, integer nrhs, double precision, dimension( lda, * ) a,
integer lda, double precision, dimension( ldaf, * ) af, integer ldaf,
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, * ) errs_n, double precision, dimension( nrhs, * ) errs_c, 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_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. The double-precision twin of the one above β same lore, different letters π
Purpose:
DLA_GERFSX_EXTENDEDimproves 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 byDGERFSXto perform iterative refinement. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments forERRS_NandERRS_Cfor details of the error bounds. Note that this subroutine is only responsible for setting the second fields ofERRS_NandERRS_C. π
Parameters
PREC_TYPE(INTEGER) β Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis a CHARACTER andP:= '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 a CHARACTER andT:= '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 allowed, she's flexible π§NRHS(INTEGER) β The number of right-hand-sides, i.e., the number of columns of the matrixB.A(DOUBLE PRECISION array, dimension (LDA,N)) β On entry, theN-by-NmatrixA. The main character πLDA(INTEGER) β The leading dimension of the arrayA.LDA >= max(1,N).AF(DOUBLE PRECISION array, dimension (LDAF,N)) β The factorsLandUfrom the factorizationA = P*L*Uas computed byDGETRF.LDAF(INTEGER) β The leading dimension of the arrayAF.LDAF >= max(1,N).IPIV(INTEGER array, dimension (N)) β The pivot indices from the factorizationA = P*L*Uas computed byDGETRF; rowiof the matrix was interchanged with rowIPIV(i). The receipts of who swapped with whom π«ΆCOLEQU(LOGICAL) β If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly. So don't lie about it, bestie πC(DOUBLE PRECISION array, 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, stay in your radix-power lane.B(DOUBLE PRECISION array, dimension (LDB,NRHS)) β The right-hand-side matrixB.LDB(INTEGER) β The leading dimension of the arrayB.LDB >= max(1,N).Y(DOUBLE PRECISION array, dimension (LDY,NRHS)) β On entry, the solution matrixX, as computed byDGETRS. On exit, the improved solution matrixY. Glow-up arc πΈLDYLDYβ INTEGER, the leading dimension of the arrayY. And bestie,LDY >= max(1,N). Non-negotiable, the compiler is not gonna hold your hand on this one πBERR_OUTβ DOUBLE PRECISION array, dimension(NRHS). On exit,BERR_OUT(j)is holding the componentwise relative backward error for right-hand-sidej, straight from this iconic little 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β INTEGER that literally decides which error bounds you get back (seeERRS_NandERRS_C, they're the receipts):- If
N_NORMS >= 1β normwise error bounds, you get the vibe-level accuracy. - If
N_NORMS >= 2β componentwise error bounds, every single entry gets checked. thorough queen behavior π
- If
ERRS_Nβ DOUBLE PRECISION array, dimension(NRHS, N_ERR_BNDS). For each right-hand side it's stuffed with info about all the different 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 below. There are currently up to three pieces of information returned.
The first index in ERRS_N(i,:) corresponds to the *i*th right-hand side.
The second index in ERRS_N(:,err) holds 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 istrue.err = 3β reciprocal condition number: estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (yes, that sentence is literally cut off in the source like that, no cap π not me fixing Fortran docs)
These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. π«Ά
ERRS_Cβ DOUBLE PRECISION array, dimension(NRHS, N_ERR_BNDS). Same deal, but for componentwise relative error:
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, bestie, they're linked) and by the type of error information described below. There are currently up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed. And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. slay, partial data β¨
The first index in ERRS_C(i,:) corresponds to the *i*th right-hand side.
The second index in ERRS_C(:,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 istrue.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 sentence energy π)
These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
RESβ DOUBLE PRECISION array, dimension(N). Workspace that holds the intermediate residual. it's giving scratch paper πAYBβ DOUBLE PRECISION array, dimension(N). Workspace. And here's the fun part: this can be the same workspace you passed forY_TAIL. sharing is caring, we love memory efficiency πDYβ DOUBLE PRECISION array, dimension(N). Workspace holding the intermediate solution. main character workspace, honestly πY_TAILβ DOUBLE PRECISION array, dimension(N). Workspace holding the trailing bits of the intermediate solution. the little crumbs at the end, we love her πRCONDβ DOUBLE PRECISION. Reciprocal scaled condition number β an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if equilibration was done). If this is less than machine precision (in particular, if it is zero), the matrix is singular to working precision. β οΈ Big note though: the error may still be small even if this number is very small and the matrix appears ill-conditioned. so don't panic-spiral, okay? πITHRESHβ INTEGER. The maximum number of residual computations allowed for refinement. Default is10. For'aggressive'set it to100to permit convergence using approximate factorizations or factorizations other than LU. π¨ But if the factorization uses a technique other than Gaussian elimination, the guarantees inERRS_NandERRS_Cmay no longer be trustworthy. you've been warned, bestie.RTHRESHβ DOUBLE PRECISION. Decides when to stop refining if the error estimate stops decreasing. Refinement stops when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i), wherenorm(Z)is the infinity norm ofZ.RTHRESHsatisfies0 < RTHRESH <= 1. 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β DOUBLE PRECISION. Tells us when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, and we define stable as the relative change in each component being less thanDZ_UB. 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. Default value is.FALSE.. sometimes you just gotta ignore the componentwise drama πINFOβ INTEGER, the final verdict:= 0: successful exit. we ate. π< 0: ifINFO = -i, the *i*th argument toDGETRShad an illegal value. π
π¦ Author π¦
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 390 of file dla_gerfsx_extended.f. go off, line 390 π
β subroutine sla_gerfsx_extended β
okay so now the single-precision sibling steps in, and she's got a whole signature that is long long. Behold:
subroutine sla_gerfsx_extended (integer prec_type, integer trans_type,
integer n, integer nrhs, real, dimension( lda, * ) a, integer lda, real,
dimension( ldaf, * ) af, integer ldaf, 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, * ) errs_n, real,
dimension( nrhs, * ) errs_c, 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_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution. the whole package, honestly π
π Purpose π
SLA_GERFSX_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 SGERFSX to perform iterative refinement. On top of the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERRS_N and ERRS_C for the details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. β¨
π«Ά Parameters π«Ά
and the parameter train keeps on rolling, starting withβ¦
PREC_TYPEβPREC_TYPEβINTEGER. This one tells the routine which intermediate precision to use while it's refining, bestie. The value comes fromILAPREC(P)wherePis aCHARACTER, and P behaves like this:= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
TRANS_TYPEβINTEGER. Specifies the transposition operation on A, okay? The value is defined byILATRANS(T)whereTis aCHARACTER, and T goes:= 'N': No transpose= 'T': Transpose= 'C': Conjugate transpose
NβINTEGER. The number of linear equations, aka the order of the matrix A. LiterallyN >= 0, no exceptions πNRHSβINTEGER. The number of right-hand-sides, i.e. the number of columns of the matrix B. Multiple besties, one A β¨AβREAL array, dimension (LDA,N). On entry, the N-by-N matrix A. That's her, the main character πLDAβINTEGER. The leading dimension of the array A.LDA >= max(1,N). Respect the constraint fr fr.AFβREAL array, dimension (LDAF,N). The factors L and U from the factorizationA = P*L*Uas computed bySGETRF. Pre-chewed A, iconic.LDAFβINTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIVβINTEGER array, dimension (N). The pivot indices from the factorizationA = P*L*Uas computed bySGETRF; row i of the matrix was interchanged with rowIPIV(i). Receipts of every glow-up π«ΆCOLEQUβ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 β like, this is not a vibe you can skip, okay?CβREAL array, dimension (N). The column scale factors for A. IfCOLEQU = .FALSE., C is not accessed β she's not invited to that party. 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.
lowkey this one matters: screw up the scaling and your error estimates are giving speculation, not math π
BβREAL array, dimension (LDB,NRHS). The right-hand-side matrix B. The other half of the equation, always.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).YβREAL array, dimension (LDY,NRHS). On entry, the solution matrix X, as computed bySGETRS. On exit, the improved solution matrix Y. She comes in as X and leaves as Y β a whole character arc πLDYβINTEGER. The leading dimension of the array Y.LDY >= max(1,N).BERR_OUTβ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. So, like, the homework is done by someone else and you just collect the grade π
N_NORMSβINTEGER. Determines which error bounds to return (seeERRS_NandERRS_C). Like a little menu:- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
- If
ERRS_Nβ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 ERRS_N(i,:) corresponds to the ith right-hand side.
The second index in ERRS_N(:,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 matrix Z. LetZ = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
ngl the manpage literally drops a word at "the error estimate is ." β that's the original, we're not fixing it, we're reporting it π
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
ERRS_Cβ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 ERRS_C is not accessed β she's on read receipt mode only. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERRS_C(i,:) corresponds to the ith right-hand side.
The second index in ERRS_C(:,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 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 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βREAL array, dimension (N). Workspace to hold the intermediate residual. Scrap paper energy πAYBβREAL array, dimension (N). Workspace. This can be the same workspace passed forY_TAILβ sharing is caring, we love a sustainable buffer.DYβREAL array, dimension (N). Workspace to hold the intermediate solution.Y_TAILβREAL array, dimension (N). Workspace to hold the trailing bits of the intermediate solution. The little crumbs at the end, we keep them β¨RCONDβREAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision β like actually singular, no cap. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't spiral just because the number looks tiny, bestie, the vibes can still be fine πITHRESHβINTEGER. The maximum number of residual computations allowed for refinement. The default is10. For'aggressive'set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inERRS_NandERRS_Cmay no longer be trustworthy.
so if you go aggressive-and-not-LU, the guarantees start wearing a disguise β the manpage says they may no longer be trustworthy, and we respect the disclaimer π₯
RTHRESHβ
RTHRESH
RTHRESH is REAL π
okay so this one decides when to stop refining if the error estimate just. stops decreasing. like bestie, we're not gonna loop forever hoping for a miracle, right? π«Ά 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. And <yellow>RTHRESH</yellow> satisfies 0 < RTHRESH <= 1. 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. iykyk β¨
DZ_UB
DZ_UB is REAL π¦
this cutie determines when to start considering componentwise convergence. and no, 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. Default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details. periodt π
IGNORE_CWISE
IGNORE_CWISE is LOGICAL π
If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. simple as that, no notes π
INFO
INFO is INTEGER β
= 0: Successful exit. we love a zero, slay π< 0: ifINFO = -i, the ith argument to SGETRS had an illegal value π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition
Definition at line 391 of file sla_gerfsx_extended.f.
π subroutine zla_gerfsx_extended
subroutine zla_gerfsx_extended (integer prec_type, integer trans_type,
integer n, integer nrhs, complex*16, dimension( lda, * ) a, integer lda,
complex*16, dimension( ldaf, * ) af, integer ldaf, 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, * ) errs_n, double precision,
dimension( nrhs, * ) errs_c, 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_GERFSX_EXTENDED
ZLA_GERFSX_EXTENDED β say that three times fast, I dare you π
Purpose
okay bestie, the whole point of ZLA_GERFSX_EXTENDED is that it 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 ZGERFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERRS_N and ERRS_C for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. king of doing exactly one job π
β¨ 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': SingleP = 'D': DoubleP = 'I': IndigenousP = '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 transposeT = 'T': TransposeT = 'C': Conjugate transpose
N
N is INTEGER β
The number of linear equations, i.e., the order of the matrix A. N >= 0. (yes bestie, zero is allowed, we're not judging π)
NRHS
NRHS is INTEGER πΈ
The number of right-hand-sides, i.e., the number of columns of the matrix B.
A
A is COMPLEX*16 array, dimension (LDA,N) π
On entry, the N-by-N matrix A. main character matrix energy fr fr π
LDA
LDA is INTEGER π
The leading dimension of the array A. LDA >= max(1,N).
AF
AF is COMPLEX*16 array, dimension (LDAF,N) π¦
The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
LDAF
LDAF is INTEGER β¨
The leading dimension of the array AF. LDAF >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N) π₯
The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). it's giving "put it back where it belongs" π
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. like, don't skip it, it matters π«Ά
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. so like, do not play with this one bestie π
B
B is COMPLEX*16 array, dimension (LDB,NRHS) π
The right-hand-side matrix B. the moment it all comes down to π
LDB
LDB is INTEGER π
The leading dimension of the array B. LDB >= max(1,N).
Y
Y is COMPLEX*16 array, dimension (LDY,NRHS) πΈ
On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix Y. glow-up in real time, we love to see it β¨
LDY
LDY is INTEGER π¦
The leading dimension of the array Y. LDY >= max(1,N).
BERR_OUT
BERR_OUT is DOUBLE PRECISION 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 ZLA_LIN_BERR. iconic helper routine behavior ngl π
N_NORMS
N_NORMS is INTEGER π
Determines which error bounds to return (see ERRS_N and ERRS_C).
- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
ERRS_N
ERRS_N 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 ERRS_N(i,:) corresponds to the ith right-hand side.
The second index in ERRS_N(:,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 approximately1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
ERRS_C
ERRS_Cβ okay soERRS_Cis aDOUBLE PRECISIONarray, 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 ERRS_C is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. π«Ά
The first index in ERRS_C(i,:) corresponds to the ith right-hand side.
The second index in ERRS_C(:,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βRESisCOMPLEX*16array, dimension(N). Workspace to hold the intermediate residual. πAYBβAYBisDOUBLE PRECISIONarray, dimension(N). Workspace. π¦DYβDYisCOMPLEX*16array, dimension(N). Workspace to hold the intermediate solution. πΈY_TAILβY_TAILisCOMPLEX*16array, dimension(N). Workspace to hold the trailing bits of the intermediate solution. π§RCONDβRCONDisDOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter 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. πITHRESHβITHRESHisINTEGER. 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 inERRS_NandERRS_Cmay no longer be trustworthy. π₯RTHRESHβRTHRESHisDOUBLE PRECISION. Determines when to stop refinement 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 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_UBisDOUBLE PRECISION. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, which we define as the relative change in each component being less thanDZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details. πIGNORE_CWISEβIGNORE_CWISEisLOGICAL. If.TRUE.then ignore componentwise convergence. Default value is.FALSE.. βINFOβINFOisINTEGER.= 0: Successful exit. π< 0: ifINFO = -i, the ith argument toZGETRShad an illegal value. π
π AUTHOR
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 390 of file zla_gerfsx_extended.f. π
πΈ AUTHOR
Generated automatically by Doxygen for LAPACK from the source code. π§
This footer energy is LAPACK Version 3.12.0 + la_gerfsx_extended(3), straight from the source code β source-code realness, no cap. Bye bestie! πβ¨
π¦ 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